aeubanks added inline comments.

================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:310-313
           for (; J != AnnotatedLines.begin(); --J)
-            if (!(*J)->InPPDirective && (*J)->Level < TheLine->Level)
+            if ((TheLine->InPPDirective || !(*J)->InPPDirective) &&
+                (*J)->Level < TheLine->Level)
               break;
----------------
owenpan wrote:
> Or simply return before the `for` loop if `TheLine->InPPDirective` is true?
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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124036/new/

https://reviews.llvm.org/D124036

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to