forked from OSchip/llvm-project
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:
parent
14a07365cb
commit
1b93f1ba9f
|
@ -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())
|
||||
|
|
|
@ -293,3 +293,15 @@ namespace test5 {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PR9303: invalid assert on this
|
||||
namespace test6 {
|
||||
bool cond();
|
||||
void test() {
|
||||
try {
|
||||
lbl:
|
||||
if (cond()) goto lbl;
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue