From 53e6a5d60c7be3ce3fc261e08b3926bb12a27663 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 14 Aug 2014 19:47:06 +0000 Subject: Don't Lex past EOF when lexing _Pragma Fixes PR20662. llvm-svn: 215672 --- clang/lib/Lex/Pragma.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Lex/Pragma.cpp') diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 356ab2bc9b3..af65bbfc9b1 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -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); -- cgit v1.2.3