mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-07 08:34:59 +00:00
Fix a crash on a top-level objc string, patch by Nico Weber
llvm-svn: 45370
This commit is contained in:
parent
05568bbd98
commit
11221033be
@ -87,9 +87,9 @@ Parser::StmtResult Parser::ParseStatementOrDeclaration(bool OnlyStatement) {
|
||||
case tok::at: // May be a @try or @throw statement
|
||||
{
|
||||
AtLoc = ConsumeToken(); // consume @
|
||||
if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_try)
|
||||
if (Tok.isObjCAtKeyword(tok::objc_try))
|
||||
return ParseObjCTryStmt(AtLoc);
|
||||
else if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_throw)
|
||||
else if (Tok.isObjCAtKeyword(tok::objc_throw))
|
||||
return ParseObjCThrowStmt(AtLoc);
|
||||
ExprResult Res = ParseExpressionWithLeadingAt(AtLoc);
|
||||
if (Res.isInvalid) {
|
||||
|
6
clang/test/Parser/expressions.m
Normal file
6
clang/test/Parser/expressions.m
Normal file
@ -0,0 +1,6 @@
|
||||
// RUN: clang -parse-noop %s
|
||||
|
||||
void test1() {
|
||||
@"s"; // expected-warning {{expression result unused}}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user