[PATCH] D77062: [analyzer] Improve zero assumption in CStringChecke::assumeZero

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 01:36:36 PDT 2020


steakhal added a comment.

In D77062#1976414 <https://reviews.llvm.org/D77062#1976414>, @Szelethus wrote:

> I think what what be great to see here (and this seems to be the thing @NoQ is fishing for) is not to change an if branch and avoid running into the crash, but rather find out why `assumeZero` was ever called with a `nonloc` value, which shouldn't really happen. We're treating the symptom, not curing the illness, if you will. The `SVal` (if its `DefinedSVal`) is supposed to be always `MemRegionVal` here, is that right? Maybe if we tried to add an assert here, that could help nail where the actual issue is coming from. It's probably in `evalStrcpyCommon`, judging from the bug report you linked in your summary.

I would not accept this patch unless this investigation is done. However, I'm not inherently against this change.


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

https://reviews.llvm.org/D77062



More information about the cfe-commits mailing list