diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-31 18:53:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-31 18:53:44 +0000 |
commit | 2831092e8063c01aa307bc62ff5e9eb8db2ceedc (patch) | |
tree | 6c61154178b9d93b7c7682046d8db4f39a325dbe /lib | |
parent | 220947bd5a66b0f25f5e74d6029769dfb34f07b4 (diff) |
fix a crash on:
__has_builtin
in an empty file, as we were overwriting the EOF token. Overwriting an arbitrary token
never seems like a good idea in the error case. This fixes a bug reported on the GCC
list :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 035272279d..d8cd440391 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1032,7 +1032,8 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { } OS << (int)Value; - Tok.setKind(tok::numeric_constant); + if (IsValid) + Tok.setKind(tok::numeric_constant); } else if (II == Ident__has_include || II == Ident__has_include_next) { // The argument to these two builtins should be a parenthesized |