[cfe-commits] r45489 - in /cfe/trunk: Parse/ParseObjc.cpp test/Parser/objc-messaging-neg-1.m
Fariborz Jahanian
fjahanian at apple.com
Wed Jan 2 10:09:46 PST 2008
Author: fjahanian
Date: Wed Jan 2 12:09:46 2008
New Revision: 45489
URL: http://llvm.org/viewvc/llvm-project?rev=45489&view=rev
Log:
Prevent crash on incorrect objc messaging expression.
Added:
cfe/trunk/test/Parser/objc-messaging-neg-1.m
Modified:
cfe/trunk/Parse/ParseObjc.cpp
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=45489&r1=45488&r2=45489&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Wed Jan 2 12:09:46 2008
@@ -1342,13 +1342,13 @@
} else if (!selIdent) {
Diag(Tok, diag::err_expected_ident); // missing selector name.
SkipUntil(tok::semi);
- return 0;
+ return true;
}
if (Tok.isNot(tok::r_square)) {
Diag(Tok, diag::err_expected_rsquare);
SkipUntil(tok::semi);
- return 0;
+ return true;
}
SourceLocation RBracloc = ConsumeBracket(); // consume ']'
Added: cfe/trunk/test/Parser/objc-messaging-neg-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-messaging-neg-1.m?rev=45489&view=auto
==============================================================================
--- cfe/trunk/test/Parser/objc-messaging-neg-1.m (added)
+++ cfe/trunk/test/Parser/objc-messaging-neg-1.m Wed Jan 2 12:09:46 2008
@@ -0,0 +1,7 @@
+// RUN: clang -fsyntax-only -verify %s
+
+int main()
+ {
+ id a;
+ [a bla:0 6:7]; // expected-error {{expected ']'}}
+ }
More information about the cfe-commits
mailing list