[PATCH] D54466: [Analyzer] Iterator Checkers - Use the region of the topmost base class for iterators stored in a region

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 21 06:34:20 PST 2018


baloghadamsoftware added a comment.

In https://reviews.llvm.org/D54466#1297887, @NoQ wrote:

> > I marked this patch as WIP because I could not create a test-case for it. However in real projects this patch seems to reduce false positives significantly.
>
> False positives are hard to reduce via delta-debugging because they can be accidentally reduced into true positives, because the distinction between true positives and false positives cannot be tested automatically. But once you fix the false positive, `creduce` can be used to reduce them by writing down the condition as "the positive is there on the original clang but not on the modified clang". Strongly recommended :)


`creduce` did not work (continous `clang_delta` crash) but somehow I managed to create tests.

>> Hmmm, shouldn't we add this to `MemRegion`'s interface instead?

This:

> I wouldn't insist, but this does indeed sound useful. I suggest `MemRegion::getMostDerivedObjectRegion()` or something like that.

vs

> Also, ugh, that nomenclature: the base region of `CXXBaseObjectRegion` in fact represents the //derived// object.

So if `CXXBaseObjectRegion` is the derived object, then `MemRegion::getMostDerivedObjectRegion()` gets the least derived object region now?


https://reviews.llvm.org/D54466





More information about the cfe-commits mailing list