[cfe-commits] r69523 - /cfe/trunk/tools/clang-cc/CacheTokens.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 19 00:25:42 PDT 2009
Author: lattner
Date: Sun Apr 19 02:25:40 2009
New Revision: 69523
URL: http://llvm.org/viewvc/llvm-project?rev=69523&view=rev
Log:
make PTH not crash on a null directive (# on its own line)
Modified:
cfe/trunk/tools/clang-cc/CacheTokens.cpp
Modified: cfe/trunk/tools/clang-cc/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/CacheTokens.cpp?rev=69523&r1=69522&r2=69523&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/CacheTokens.cpp (original)
+++ cfe/trunk/tools/clang-cc/CacheTokens.cpp Sun Apr 19 02:25:40 2009
@@ -475,8 +475,10 @@
// Get the next token.
L.LexFromRawLexer(Tok);
-
- assert(!Tok.isAtStartOfLine());
+
+ // If we see the start of line, then we had a null directive "#".
+ if (Tok.isAtStartOfLine())
+ goto NextToken;
// Did we see 'include'/'import'/'include_next'?
if (Tok.isNot(tok::identifier)) {
More information about the cfe-commits
mailing list