aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-30 00:06:43 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-30 00:06:43 +0000
commit891f80ec2fb2d1730b769467d602689e1080845b (patch)
tree37c93270c10f1206a83d9f3f4b948650ae9effd9 /lib/CodeGen/CGException.cpp
parentf406d9c68762163cf817230bca13030e4d10514e (diff)
Teach EHCleanupBlock to deal appropriately with the possibility that there
might not have been an insertion block set at start. Fixes PR6975. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
-rw-r--r--lib/CodeGen/CGException.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 405df40c32..a18aaf61c1 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -696,7 +696,11 @@ CodeGenFunction::EHCleanupBlock::~EHCleanupBlock() {
// Resume inserting where we started, but put the new cleanup
// handler in place.
- CGF.Builder.SetInsertPoint(PreviousInsertionBlock);
+ if (PreviousInsertionBlock)
+ CGF.Builder.SetInsertPoint(PreviousInsertionBlock);
+ else
+ CGF.Builder.ClearInsertionPoint();
+
if (CGF.Exceptions)
CGF.setInvokeDest(CleanupHandler);
}