[cfe-commits] r51622 - in /cfe/trunk: lib/Parse/Parser.cpp test/Parser/asm.c

Chris Lattner sabre at nondot.org
Tue May 27 16:32:44 PDT 2008


Author: lattner
Date: Tue May 27 18:32:43 2008
New Revision: 51622

URL: http://llvm.org/viewvc/llvm-project?rev=51622&view=rev
Log:
Fix a couple crashes on invalid input.

Modified:
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/test/Parser/asm.c

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=51622&r1=51621&r2=51622&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Tue May 27 18:32:43 2008
@@ -328,6 +328,7 @@
 
     if (!Result.isInvalid)
       return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(), Result.Val);
+    return 0;
   }
   case tok::at:
     // @ is not a legal token unless objc is enabled, no need to check.
@@ -653,7 +654,7 @@
   
   if (Tok.isNot(tok::l_paren)) {
     Diag(Tok, diag::err_expected_lparen_after, "asm");
-    return 0;
+    return true;
   }
   
   ConsumeParen();

Modified: cfe/trunk/test/Parser/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/asm.c?rev=51622&r1=51621&r2=51622&view=diff

==============================================================================
--- cfe/trunk/test/Parser/asm.c (original)
+++ cfe/trunk/test/Parser/asm.c Tue May 27 18:32:43 2008
@@ -8,3 +8,8 @@
   asm("foo" : "=r" (a)); // expected-error {{use of undeclared identifier 'a'}}
   asm("foo" : : "r" (b)); // expected-error {{use of undeclared identifier 'b'}} 
 }
+
+
+// rdar://5952468
+__asm ; // expected-error {{expected '(' after 'asm'}}
+





More information about the cfe-commits mailing list