diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-19 07:25:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-19 07:25:40 +0000 |
| commit | 9941ce33c34d2d795d3e5c942b7db1bb7e7ae5b4 (patch) | |
| tree | e81febcafa77dc7e58087de2610ac8ecdd9cc865 | |
| parent | 6ada5d72f84632be8b082c47624fef523c219431 (diff) | |
| download | bcm5719-llvm-9941ce33c34d2d795d3e5c942b7db1bb7e7ae5b4.tar.gz bcm5719-llvm-9941ce33c34d2d795d3e5c942b7db1bb7e7ae5b4.zip | |
make PTH not crash on a null directive (# on its own line)
llvm-svn: 69523
| -rw-r--r-- | clang/tools/clang-cc/CacheTokens.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/tools/clang-cc/CacheTokens.cpp b/clang/tools/clang-cc/CacheTokens.cpp index 6e2a20d9878..c417eb49028 100644 --- a/clang/tools/clang-cc/CacheTokens.cpp +++ b/clang/tools/clang-cc/CacheTokens.cpp @@ -475,8 +475,10 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) { // 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)) { |

