summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGCleanup.cpp2
-rw-r--r--clang/test/CodeGenCXX/exceptions.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index 374ede880d2..1d7901a2db4 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -876,7 +876,7 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) {
///
/// As a side-effect, this method clears the insertion point.
void CodeGenFunction::EmitBranchThroughCleanup(JumpDest Dest) {
- assert(Dest.getScopeDepth().encloses(EHStack.getInnermostNormalCleanup())
+ assert(Dest.getScopeDepth().encloses(EHStack.stable_begin())
&& "stale jump destination");
if (!HaveInsertPoint())
diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp
index 84d55c8f190..80818189f48 100644
--- a/clang/test/CodeGenCXX/exceptions.cpp
+++ b/clang/test/CodeGenCXX/exceptions.cpp
@@ -293,3 +293,15 @@ namespace test5 {
}
}
}
+
+// PR9303: invalid assert on this
+namespace test6 {
+ bool cond();
+ void test() {
+ try {
+ lbl:
+ if (cond()) goto lbl;
+ } catch (...) {
+ }
+ }
+}
OpenPOWER on IntegriCloud