From 97ff7763dca7b2717cc8e6fdf5d6cb7a0b28d62e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 22 Jan 2008 19:34:51 +0000 Subject: Fix PR1936, a crash on malformed #if. Thanks to Neil for noticing this! llvm-svn: 46256 --- clang/Lex/Preprocessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/Lex/Preprocessor.cpp') diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp index cb5a350758a..d8310932687 100644 --- a/clang/Lex/Preprocessor.cpp +++ b/clang/Lex/Preprocessor.cpp @@ -939,9 +939,9 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName, // an argument value in a macro could expand to ',' or '(' or ')'. LexUnexpandedToken(Tok); - if (Tok.is(tok::eof)) { + if (Tok.is(tok::eof) || Tok.is(tok::eom)) { // "#if f(" & "#if f(\n" Diag(MacroName, diag::err_unterm_macro_invoc); - // Do not lose the EOF. Return it to the client. + // Do not lose the EOF/EOM. Return it to the client. MacroName = Tok; return 0; } else if (Tok.is(tok::r_paren)) { -- cgit v1.2.3