Fix FunctionInlining pass assertion failure:
authorChris Lattner <sabre@nondot.org>
Mon, 16 Sep 2002 22:30:20 +0000 (22:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 16 Sep 2002 22:30:20 +0000 (22:30 +0000)
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3768 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/InlineSimple.cpp

index 54092ae91b4a328fdb099ab71df0a71803a444d6..d88a923e2257dd8a5898b7e8a1e063d3cfcf0c94 100644 (file)
@@ -163,7 +163,7 @@ bool InlineFunction(CallInst *CI) {
       }
 
       // Add a branch to the code that was after the original Call.
-      new BranchInst(NewBB, IBB->end());
+      IBB->getInstList().push_back(new BranchInst(NewBB));
       break;
     }
     case Instruction::Br: