[PATCH] D41266: [analyzer] With c++-allocator-inlining, fix memory space for operator new pointers.
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 14 17:17:04 PST 2017
NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet.
Herald added subscribers: cfe-commits, rnkovacs.
Default global `operator new()`, like `malloc()`, should return heap pointers, which in the analyzer are represented by `SymbolicRegion`s with `HeapSpaceRegion` as their parent.
In the `-analyzer-config c++-allocator-inlining` mode, this was broken, and regular `SymbolicRegion`s were returned instead, which have `UnknownSpaceRegion` as their parent.
This patch fixes this straightforwardly on `ExprEngine` side. We may want to delegate this job to the checkers though `evalCall`, but for now this mode doesn't support `evalCall` for `operator new()`, and i'm not sure if it'd be used much.
With this patch going on top of previous patches, enabling `c++-allocator-inlining` by default causes no regressions on tests (causes some improvements though). It doesn't mean it works (we still have callbacks broken, path diagnostic pieces unsupported, and i've just noticed one more void element region crash), just a psychological checkpoint.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4719 bytes
Desc: not available
More information about the cfe-commits