Tame an assert; the scope depth of a jump destination does not

necessarily enclose the innermost normal cleanup depth, because
the top of the jump scope stack might be an EH cleanup or EH scope.
Fixes PR9303.

llvm-svn: 126472
This commit is contained in:
John McCall 2011-02-25 04:19:13 +00:00
parent 14a07365cb
commit 1b93f1ba9f
2 changed files with 13 additions and 1 deletions

View File

@ -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())

View File

@ -293,3 +293,15 @@ namespace test5 {
}
}
}
// PR9303: invalid assert on this
namespace test6 {
bool cond();
void test() {
try {
lbl:
if (cond()) goto lbl;
} catch (...) {
}
}
}