This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Make isSubRegionOf reflexive
ClosedPublic

Authored by george.karpenkov on Jan 16 2018, 3:43 PM.

Details

Summary

All usages of isSubRegionOf separately check for reflexive case, and in any case, set theory tells us that each set is a subset of itself.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ accepted this revision.Jan 16 2018, 3:52 PM

Yeah, i guess we thought that only SubRegion shall ever be a sub-region. But in fact we have too much inheritance-for-code-reuse in MemRegion hierarchy for those abstract classes to have any deep meaning.

lib/StaticAnalyzer/Core/MemRegion.cpp
106–107

Change this to do..while to avoid the initial check?

This revision is now accepted and ready to land.Jan 16 2018, 3:52 PM
This revision was automatically updated to reflect the committed changes.