This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Do not crash if the assumption added in TrustNonNullChecker is enough to make the state unfeasible
ClosedPublic

Authored by george.karpenkov on Oct 3 2018, 2:44 PM.

Diff Detail

Repository
rC Clang

Event Timeline

For the record, it's not particularly obvious that state->assume can return nullptr.

NoQ accepted this revision.Oct 3 2018, 3:07 PM

Aha, yep, that should have been checked. Returning null state from evalAssume() is the correct thing to do when you want to generate a sink. But you should be careful not to put null state into C.addTransition(), because that won't generate a sink as you might expect.

This revision is now accepted and ready to land.Oct 3 2018, 3:07 PM
This revision was automatically updated to reflect the committed changes.
MaskRay added a subscriber: MaskRay.Oct 3 2018, 4:50 PM

This change appears to break test/Analysis/trustnonnullchecker_test.m in non-optimized (OPTIMIZE not defined) mode. Can you take a look?