summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-01-19 10:51:05 +0000
committerDaniel Jasper <djasper@google.com>2015-01-19 10:51:05 +0000
commit9d22bcc53e70a597ccdfc2c4c1a2276a5bbeee00 (patch)
tree83b705838eb30f128272c8c0a3cb481cde49c7ff /clang/lib
parent2bd7a64d127785d9ee4b5644f92f0d1eabf603e0 (diff)
downloadbcm5719-llvm-9d22bcc53e70a597ccdfc2c4c1a2276a5bbeee00.tar.gz
bcm5719-llvm-9d22bcc53e70a597ccdfc2c4c1a2276a5bbeee00.zip
clang-format: Fix assertion when trying to build a nullptr StringRef.
llvm-svn: 226448
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 00dc1bda538..23b9d550fb1 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -549,6 +549,7 @@ void UnwrappedLineParser::conditionalCompilationEnd() {
void UnwrappedLineParser::parsePPIf(bool IfDef) {
nextToken();
bool IsLiteralFalse = (FormatTok->Tok.isLiteral() &&
+ FormatTok->Tok.getLiteralData() != nullptr &&
StringRef(FormatTok->Tok.getLiteralData(),
FormatTok->Tok.getLength()) == "0") ||
FormatTok->Tok.is(tok::kw_false);
OpenPOWER on IntegriCloud