Skip to content

Commit 9841d71

Browse files
committed
[Lex] fix lexing malformed pragma within include directive
1 parent 4768173 commit 9841d71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Lex/Pragma.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,12 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
220220
if (!tok::isStringLiteral(Tok.getKind())) {
221221
Diag(PragmaLoc, diag::err__Pragma_malformed);
222222
// Skip bad tokens, and the ')', if present.
223-
if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::eof))
223+
if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::eof) && Tok.isNot(tok::eod))
224224
Lex(Tok);
225225
while (Tok.isNot(tok::r_paren) &&
226226
!Tok.isAtStartOfLine() &&
227-
Tok.isNot(tok::eof))
227+
Tok.isNot(tok::eof) &&
228+
Tok.isNot(tok::eod))
228229
Lex(Tok);
229230
if (Tok.is(tok::r_paren))
230231
Lex(Tok);

0 commit comments

Comments
 (0)