diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-12 20:17:17 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-12 20:17:17 +0000 |
commit | 89a0daa0ec1fbc43489e3bb9e9648c816258f00f (patch) | |
tree | e55f07046ebc0ead79aac03c57871d98d13a9573 /lib/Format/UnwrappedLineParser.cpp | |
parent | be8e36c5ee4559a5f662dbcfd827d52e02c039a9 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 922671600d..28522a3e32 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/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) |