[cfe-commits] r145662 - /cfe/trunk/lib/Parse/ParseStmt.cpp

Ted Kremenek kremenek at apple.com
Thu Dec 1 17:30:14 PST 2011


Author: kremenek
Date: Thu Dec  1 19:30:14 2011
New Revision: 145662

URL: http://llvm.org/viewvc/llvm-project?rev=145662&view=rev
Log:
Fix test regression introduced by r145656.  When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.

Modified:
    cfe/trunk/lib/Parse/ParseStmt.cpp

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=145662&r1=145661&r2=145662&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Thu Dec  1 19:30:14 2011
@@ -1759,8 +1759,13 @@
   T.consumeOpen();
 
   ExprResult AsmString(ParseAsmStringLiteral());
-  if (AsmString.isInvalid())
+  if (AsmString.isInvalid()) {
+    // If the reason we are recovering is because of an improper string
+    // literal, it makes the most sense just to consume to the ')'.
+    if (isTokenStringLiteral())
+      T.skipToEnd();
     return StmtError();
+  }
 
   SmallVector<IdentifierInfo *, 4> Names;
   ExprVector Constraints(Actions);





More information about the cfe-commits mailing list