[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 9 20:00:12 PST 2018
NoQ added a comment.
In https://reviews.llvm.org/D41406#970985, @xazax.hun wrote:
> Do you have a plan for the new false negatives when `c++-allocator-inlining` is on? Should the user mark allocation functions with attributes?
Not immediately - the immediate plan is to simply believe that we'd either see something reasonable inside the call (eg. `malloc()` or a concrete array), or we'd rather not even try to understand what's going on and how to properly release memory in this case (avoid false positives, which is also good). I guess we shall see if it makes sense to track the allocated value anyway, even in the inlined case, and in this case we'd need to work around tracking stuff twice (eg. `operator new(size) { return malloc(size); }` would need to be tracked as both new and malloc for the purposes of mismatched deallocator check) or other unexpected issues (because `MallocChecker` has strong opinions all over the place on how allocated values normally look like). We don't have any annotations in `MallocChecker` yet, and i didn't think about adding support for them or even see if there are existing useful annotations around.
https://reviews.llvm.org/D41406
More information about the cfe-commits
mailing list