summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-12-02 01:30:14 +0000
committerTed Kremenek <kremenek@apple.com>2011-12-02 01:30:14 +0000
commiteb0a6c0a85632ce0b8181bea98cb5c450ced999f (patch)
treedde9f23c0583d7bdeb00c41608bd01443abe70a6 /clang/lib/Parse/ParseStmt.cpp
parent43a33066b42176e52707853c8570753bc60e6693 (diff)
downloadbcm5719-llvm-eb0a6c0a85632ce0b8181bea98cb5c450ced999f.tar.gz
bcm5719-llvm-eb0a6c0a85632ce0b8181bea98cb5c450ced999f.zip
Fix test regression introduced by r145656. When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'.
llvm-svn: 145662
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index fb884349291..da0e865862c 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud