[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 05:25:59 PST 2024


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/119388 at github.com>


steakhal wrote:

> [...] To fix this problem, it would be sufficient to e.g. ensure that evalEagerlyAssumeBifurcation sets LastEagerlyAssumeBifurcationAt to nullptr [...]

Sounds good to me. Let's zero it out after it's "used"/"consumed".

> [...] there might be better solutions to implement this "did EagerlyAssume split the state right now directly before this processBranch callback?" check that I need. (E.g. perhaps we could walk a few steps backwards on the ExplodedGraph -- but I don't know what kinds of nodes should I expect and I'm afraid that what I could write would run into pitfalls in unusual cases.)

Yes, it could get messy. For instance if we have multiple parent nodes due to a merge. Let's not do traversals.

I'm good with the change once the last remark is fixed.
BTW have you measured the running time implications of this patch? How much we spare?

https://github.com/llvm/llvm-project/pull/119388


More information about the cfe-commits mailing list