Skip to content

Commit

Permalink
Fix test regression introduced by r145656. When seeing a string liter…
Browse files Browse the repository at this point in the history
…al 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
  • Loading branch information
tkremenek committed Dec 2, 2011
1 parent 7f42228 commit 320fa4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Parse/ParseStmt.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 320fa4b

Please sign in to comment.