krasimir created this revision. Herald added subscribers: cfe-commits, klimek.
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8212 Repository: rC Clang https://reviews.llvm.org/D47191 Files: lib/Format/ContinuationIndenter.cpp Index: lib/Format/ContinuationIndenter.cpp =================================================================== --- lib/Format/ContinuationIndenter.cpp +++ lib/Format/ContinuationIndenter.cpp @@ -94,9 +94,9 @@ break; if (!End->Next->closesScope()) continue; - if (End->Next->MatchingParen->isOneOf(tok::l_brace, - TT_ArrayInitializerLSquare, - tok::less)) { + if (End->Next->MatchingParen && + End->Next->MatchingParen->isOneOf( + tok::l_brace, TT_ArrayInitializerLSquare, tok::less)) { const ParenState *State = FindParenState(End->Next->MatchingParen); if (State && State->BreakBeforeClosingBrace) break;
Index: lib/Format/ContinuationIndenter.cpp =================================================================== --- lib/Format/ContinuationIndenter.cpp +++ lib/Format/ContinuationIndenter.cpp @@ -94,9 +94,9 @@ break; if (!End->Next->closesScope()) continue; - if (End->Next->MatchingParen->isOneOf(tok::l_brace, - TT_ArrayInitializerLSquare, - tok::less)) { + if (End->Next->MatchingParen && + End->Next->MatchingParen->isOneOf( + tok::l_brace, TT_ArrayInitializerLSquare, tok::less)) { const ParenState *State = FindParenState(End->Next->MatchingParen); if (State && State->BreakBeforeClosingBrace) break;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits