aboutsummaryrefslogtreecommitdiff
path: root/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-22 19:34:51 +0000
committerChris Lattner <sabre@nondot.org>2008-01-22 19:34:51 +0000
commitc21d9e4766a6200dc4b2aaba3590b49114d19acd (patch)
tree6c14df7141c701c291f734067a9e50759f64aa78 /Lex/Preprocessor.cpp
parent9e18d3ed84a95be2bc42f1ce65d3bab2ee8a1e27 (diff)
Fix PR1936, a crash on malformed #if. Thanks to Neil for
noticing this! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r--Lex/Preprocessor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index cb5a350758..d831093268 100644
--- a/Lex/Preprocessor.cpp
+++ b/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)) {