diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-22 19:34:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-22 19:34:51 +0000 |
| commit | 97ff7763dca7b2717cc8e6fdf5d6cb7a0b28d62e (patch) | |
| tree | b3597f5ebe633adde64be12562142777b27685ba /clang/Lex/Preprocessor.cpp | |
| parent | 0ae6cd521907b051126ef56710cac11f38176be4 (diff) | |
| download | bcm5719-llvm-97ff7763dca7b2717cc8e6fdf5d6cb7a0b28d62e.tar.gz bcm5719-llvm-97ff7763dca7b2717cc8e6fdf5d6cb7a0b28d62e.zip | |
Fix PR1936, a crash on malformed #if. Thanks to Neil for
noticing this!
llvm-svn: 46256
Diffstat (limited to 'clang/Lex/Preprocessor.cpp')
| -rw-r--r-- | clang/Lex/Preprocessor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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(<eof>" & "#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)) { |

