diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-12-02 01:30:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-12-02 01:30:14 +0000 |
commit | 320fa4b6051ff032aaa50d924ca39e3d529dcf5f (patch) | |
tree | 047816b1b25528e8fbc588b84055db50baba6479 | |
parent | 7f422287a2ee7e515beb715f1f8915e9331469ee (diff) |
Fix test regression introduced by r145656. When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145662 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index fb88434929..da0e865862 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -1759,8 +1759,13 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) { 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); |