[cfe-commits] r68568 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/SemaObjC/exception-go-boom.m
Chris Lattner
clattner at apple.com
Tue Apr 7 20:42:11 PDT 2009
On Apr 7, 2009, at 3:56 PM, Steve Naroff wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=68568&view=rev
> Log:
> Fix <rdar://problem/6764172> [sema] crash on invalid.
Hi Steve,
Can this use ExpectAndConsume or MatchRHSPunctuation?
-Chris
>
>
> Added:
> cfe/trunk/test/SemaObjC/exception-go-boom.m
> Modified:
> cfe/trunk/lib/Parse/ParseObjc.cpp
>
> Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=68568&r1=68567&r2=68568&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseObjc.cpp Tue Apr 7 17:56:58 2009
> @@ -1294,8 +1294,14 @@
> FirstPart = Actions.ActOnParamDeclarator(CurScope,
> ParmDecl);
> } else
> ConsumeToken(); // consume '...'
> - SourceLocation RParenLoc = ConsumeParen();
> +
> + SourceLocation RParenLoc;
>
> + if (Tok.is(tok::r_paren))
> + RParenLoc = ConsumeParen();
> + else // Skip over garbage, until we get to ')'. Eat the ')'.
> + SkipUntil(tok::r_paren, true, false);
> +
> OwningStmtResult CatchBody(Actions, true);
> if (Tok.is(tok::l_brace))
> CatchBody = ParseCompoundStatementBody();
>
> Added: cfe/trunk/test/SemaObjC/exception-go-boom.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/exception-go-boom.m?rev=68568&view=auto
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/test/SemaObjC/exception-go-boom.m (added)
> +++ cfe/trunk/test/SemaObjC/exception-go-boom.m Tue Apr 7 17:56:58
> 2009
> @@ -0,0 +1,9 @@
> +// RUN: clang-cc %s -verify -fsyntax-only
> +
> +// Note: NSException is not declared.
> +void f0(id x) {
> + @try {
> + } @catch (NSException *x) { // expected-warning{{type specifier
> missing, defaults to 'int'}} expected-error{{@catch parameter is not
> an Objective-C class type}}
> + }
> +}
> +
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list