Fixes a crash introduced in D123737 where LastNonComment would be null.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang/unittests/Format/FormatTest.cpp | ||
|---|---|---|
| 13397 | not sure if you'd like a better test, this was the reduced test case I got that still caused a crash | |
| clang/lib/Format/UnwrappedLineFormatter.cpp | ||
|---|---|---|
| 309–316 | Or simply return before the for loop if TheLine->InPPDirective is true? | |
take suggestion
| clang/lib/Format/UnwrappedLineFormatter.cpp | ||
|---|---|---|
| 309–316 | I'm not 100% sure how TheLine->Level works in the presence of macros (e.g. a function that's fully defined in a macro), would we want to also search for (*J)->Level < TheLine->Level in that case? either way, I've taken your suggestion because I'd like to get this crash fix landed | |
Or simply return before the for loop if TheLine->InPPDirective is true?