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)) {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits