[PATCH] D158293: [NFC][Clang] Fix static code analyzer concern about null value dereference

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 25 15:50:00 PDT 2023


tahonermann requested changes to this revision.
tahonermann added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Lex/PPDirectives.cpp:494-495
   ++NumSkipped;
-  assert(!CurTokenLexer && CurPPLexer && "Lexing a macro, not a file?");
+  assert(!CurTokenLexer && CurPPLexer && CurLexer &&
+         "Lexing a macro, not a file?");
 
----------------
I would prefer that this `assert` be split up so that, when/if a failure occurs, we'll be able to tell which predicate failed.


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

https://reviews.llvm.org/D158293



More information about the cfe-commits mailing list