summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-12 20:17:17 +0000
committerDaniel Jasper <djasper@google.com>2013-02-12 20:17:17 +0000
commitf52ab8d60cfc3222b7b7543c8789e1c507b1b438 (patch)
treed83a8ceb6f8db8b582798e395358cc08ab7fd502 /clang/lib
parent4d3c008c7d1ec5a6ef0c4426c216c62d179df16d (diff)
downloadbcm5719-llvm-f52ab8d60cfc3222b7b7543c8789e1c507b1b438.tar.gz
bcm5719-llvm-f52ab8d60cfc3222b7b7543c8789e1c507b1b438.zip
Fix crash for incomplete labels in macros.
Still the formatting can be improved, but at least we don't assert any more. This happened when trying to format lib/Sema/SemaType.cpp. llvm-svn: 175003
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 922671600d2..28522a3e327 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -565,8 +565,8 @@ void UnwrappedLineParser::parseDoWhile() {
}
void UnwrappedLineParser::parseLabel() {
- // FIXME: remove all asserts.
- assert(FormatTok.Tok.is(tok::colon) && "':' expected");
+ if (FormatTok.Tok.isNot(tok::colon))
+ return;
nextToken();
unsigned OldLineLevel = Line->Level;
if (Line->Level > 0)
OpenPOWER on IntegriCloud