diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-23 10:09:28 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-23 10:09:28 +0000 |
commit | d33516ef32d258945fd5ec8bb4c3205e1adeb252 (patch) | |
tree | 6f17569a432df1f53013787f5a92b569292d8120 /clang/lib/Format/Format.cpp | |
parent | e941b169db764cedea0e105a2d7e2e8f0a966e16 (diff) | |
download | bcm5719-llvm-d33516ef32d258945fd5ec8bb4c3205e1adeb252.tar.gz bcm5719-llvm-d33516ef32d258945fd5ec8bb4c3205e1adeb252.zip |
Fix segfaults in the formatter.
Also: expletive deleted.
llvm-svn: 173247
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index bdcf5b67fec..90bcf6feb77 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1049,7 +1049,7 @@ public: break; case tok::kw_if: case tok::kw_while: - if (CurrentToken->is(tok::l_paren)) { + if (CurrentToken != NULL && CurrentToken->is(tok::l_paren)) { next(); if (!parseParens(/*LookForDecls=*/true)) return false; @@ -1088,7 +1088,7 @@ public: Tok->Type = TT_BinaryOperator; break; case tok::kw_operator: - if (CurrentToken->is(tok::l_paren)) { + if (CurrentToken != NULL && CurrentToken->is(tok::l_paren)) { CurrentToken->Type = TT_OverloadedOperator; next(); if (CurrentToken != NULL && CurrentToken->is(tok::r_paren)) { |