From 320fa4b6051ff032aaa50d924ca39e3d529dcf5f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 2 Dec 2011 01:30:14 +0000 Subject: [PATCH] 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 --- lib/Parse/ParseStmt.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 Names; ExprVector Constraints(Actions); -- 2.40.0