diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-06 05:01:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-06 05:01:51 +0000 |
commit | 56f64c14b77dcb443903573e242c37df0c98a491 (patch) | |
tree | 1dbe11c496c786d47bfcd6fb4f42cd3fd953a31a /clang/lib/Lex/PPDirectives.cpp | |
parent | 9ec19ea06a328cc91839b3f166a411ab410dae74 (diff) | |
download | bcm5719-llvm-56f64c14b77dcb443903573e242c37df0c98a491.tar.gz bcm5719-llvm-56f64c14b77dcb443903573e242c37df0c98a491.zip |
fix rdar://8823139, a crash on a comment in a preprocessed .s file
that contains the ## operator.
llvm-svn: 122946
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 5f4c321715d..f422d254f0f 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -654,6 +654,12 @@ TryAgain: // Return the # and the token after it. Toks[0] = SavedHash; Toks[1] = Result; + + // If the second token is a hashhash token, then we need to translate it to + // unknown so the token lexer doesn't try to perform token pasting. + if (Result.is(tok::hashhash)) + Toks[1].setKind(tok::unknown); + // Enter this token stream so that we re-lex the tokens. Make sure to // enable macro expansion, in case the token after the # is an identifier // that is expanded. |