Fix various problems found by fuzzing.
authorManuel Klimek <klimek@google.com>
Mon, 22 Nov 2021 08:07:57 +0000 (09:07 +0100)
committerManuel Klimek <klimek@google.com>
Mon, 22 Nov 2021 10:08:38 +0000 (11:08 +0100)
commit84bf5e328664db2e744c4651c52d2460b1733d09
tree20be1f679fff8d3d7790fd98e75b231dda11f5a1
parenta82942dd07ea652081f8f293b73801323a4dbbe9
Fix various problems found by fuzzing.

1. IndexTokenSource::getNextToken cannot return nullptr; some code was
still written assuming it can; make getNextToken more resilient against
incorrect input and fix its call-sites.

2. Change various asserts that can happen due to user provided input to
conditionals in the code.
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/UnwrappedLineParser.cpp
clang/lib/Format/WhitespaceManager.cpp