[clang] [NFC][Clang][Lex] Add assert to prevent null pointer dereference in Preprocessor::HandleModuleContextualKeyword (PR #211117)
Ian Li via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 23 08:50:24 PDT 2026
ianayl wrote:
> Ok, so to clarify: in this case the assertion is actually used as messaging so that coverity analysis recognizes that the value is non-null?
Essentially that's the use here; AFAIK this isn't currently an issue, but I'm assuming here an assert couldn't hurt... I'm operating under the assumption that this assert could be useful for future debugging, and that asserts would have the least impact in production, but do let me know if there's a preferred way to handle this!
> There are 60+ uses of CurPPLexer - and very few are gated by either an if or an assert - so i hope we won't have to generalize that PR too much.
Those don't seem to be an issue so far in Coverity, but if I'm reading the room right I will take more discretion w.r.t. "handling" these cases in the future 😅
https://github.com/llvm/llvm-project/pull/211117
More information about the cfe-commits
mailing list