From 413e67778d593215d2f2161a4e712c8568f1ddd0 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 28 Jul 2010 01:07:35 +0000 Subject: When creating a jump destination, its scope should be the scope of the enclosing normal cleanup, not the top of the EH stack. I'm *really* surprised this hasn't been causing more problems. Fixes rdar://problem/8231514. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109569 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index d6e498f453..396ab4e6d2 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -1055,6 +1055,9 @@ 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()) + && "stale jump destination"); + if (!HaveInsertPoint()) return; -- cgit v1.2.3-18-g5258