forked from OSchip/llvm-project
Fix crash on invalid code where a @throw statement is not followed by a ';'
llvm-svn: 101941
This commit is contained in:
parent
8f5bc9f0e1
commit
15a81e59ca
|
@ -1448,7 +1448,8 @@ Parser::OwningStmtResult Parser::ParseObjCThrowStmt(SourceLocation atLoc) {
|
|||
return StmtError();
|
||||
}
|
||||
}
|
||||
ConsumeToken(); // consume ';'
|
||||
// consume ';'
|
||||
ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@throw");
|
||||
return Actions.ActOnObjCAtThrowStmt(atLoc, move(Res), CurScope);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,3 +12,10 @@ void test1() {
|
|||
__PRETTY_FUNCTION__; // expected-warning{{expression result unused}}
|
||||
}
|
||||
@end
|
||||
|
||||
// <rdar://problem/7881045>
|
||||
// This previously triggered a crash because a ';' was expected after the @throw statement.
|
||||
void foo() {
|
||||
@throw (id)0 // expected-error{{expected ';' after @throw}}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue