[cfe-commits] r69165 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaObjC/scope-check-try-catch.m
steve naroff
snaroff at apple.com
Wed Apr 15 09:45:30 PDT 2009
On Apr 15, 2009, at 12:08 PM, Eli Friedman wrote:
> On Wed, Apr 15, 2009 at 7:38 AM, Steve Naroff <snaroff at apple.com>
> wrote:
>> Author: snaroff
>> Date: Wed Apr 15 09:38:36 2009
>> New Revision: 69165
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=69165&view=rev
>> Log:
>> Fix <rdar://problem/6791490> [clang10 regression] [sema] invalid
>> illegal jump diagnostic.
>>
>> caused by: <rdar://problem/6252084> [sema] jumps into Obj-C
>> exception blocks should be disallowed.
>
> Ah, hmm, I figured there was a problem like this; I didn't reply
> earlier because I didn't get a chance to test.
>
>> Sema::RecursiveCalcLabelScopes() and
>> Sema::RecursiveCalcJumpScopes() need to pop the ScopeStack within
>> the statement iteration loop (was outside the loop).
>
> That looks very wrong... if I'm not mistaken, the following testcase
> breaks.
>
> int test4(int x) {
> goto L; // expected-error{{illegal jump}}
> int a[x];
> test4(x);
> L:
> return sizeof a;
> }
>
> The correct solution is to use the correct parent in the PopScopeMap,
> which for an @try is either the @try itself or the containing
> ObjCAtTryStmt.
>
O.k. I'll take a look. I'll also add the test case above (which would
have been helpful).
Thanks,
snaroff
> -Eli
More information about the cfe-commits
mailing list