mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-05 21:12:31 +00:00
Don't Lex past EOF when lexing _Pragma
Fixes PR20662. llvm-svn: 215672
This commit is contained in:
parent
4133b13bd2
commit
53e6a5d60c
@ -193,7 +193,7 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
|
||||
if (!tok::isStringLiteral(Tok.getKind())) {
|
||||
Diag(PragmaLoc, diag::err__Pragma_malformed);
|
||||
// Skip this token, and the ')', if present.
|
||||
if (Tok.isNot(tok::r_paren))
|
||||
if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::eof))
|
||||
Lex(Tok);
|
||||
if (Tok.is(tok::r_paren))
|
||||
Lex(Tok);
|
||||
|
@ -11,3 +11,5 @@ _Pragma("message(\"foo \\\\\\\\ bar\")") // expected-warning {{foo \\ bar}}
|
||||
#ifdef macro
|
||||
#error #define invalid
|
||||
#endif
|
||||
|
||||
_Pragma( // expected-error{{_Pragma takes a parenthesized string literal}}
|
||||
|
Loading…
Reference in New Issue
Block a user