summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commitdac3ea6e8d712f09c3c7db89648c6c4ab4bb1166 (patch)
tree8f5d44aaf48e81a2c25cbb02ea8c93e4eb55d341 /clang/lib/CodeGen
parent786a3d910e78bc44b035db5c7f005164922fa579 (diff)
downloadbcm5719-llvm-dac3ea6e8d712f09c3c7db89648c6c4ab4bb1166.tar.gz
bcm5719-llvm-dac3ea6e8d712f09c3c7db89648c6c4ab4bb1166.zip
Teach EHCleanupBlock to deal appropriately with the possibility that there
might not have been an insertion block set at start. Fixes PR6975. llvm-svn: 102677
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGException.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 405df40c32d..a18aaf61c15 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud