From ac101e584873d72715b4fc4d2e35e3ba0ec8217b Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 7 Nov 2011 19:38:34 +0000 Subject: [PATCH] Make sure we don't insert instructions before a landingpad instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144000 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/DemoteRegToStack.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/DemoteRegToStack.cpp b/lib/Transforms/Utils/DemoteRegToStack.cpp index 8cc26492c29..3ef6b018bf8 100644 --- a/lib/Transforms/Utils/DemoteRegToStack.cpp +++ b/lib/Transforms/Utils/DemoteRegToStack.cpp @@ -97,8 +97,8 @@ AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads, InsertPt = II.getNormalDest()->begin(); } - for (; isa(InsertPt); ++InsertPt) - /* empty */; // Don't insert before any PHI nodes. + for (; isa(InsertPt) || isa(InsertPt); ++InsertPt) + /* empty */; // Don't insert before any PHI nodes or landingpad instrs. new StoreInst(&I, Slot, InsertPt); return Slot;