aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index bdcf5b67fe..90bcf6feb7 100644
--- a/lib/Format/Format.cpp
+++ b/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)) {