aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 68d10ff56e..dc00a76ff9 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -133,8 +133,9 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
EmitFunctionEpilog(*CurFnInfo, ReturnValue);
// Remove the AllocaInsertPt instruction, which is just a convenience for us.
- AllocaInsertPt->eraseFromParent();
+ llvm::Instruction *Ptr = AllocaInsertPt;
AllocaInsertPt = 0;
+ Ptr->eraseFromParent();
}
void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,