[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 15:19:04 PST 2017

NoQ added a comment.

TODOs for the future commits:

- Constructor shouldn't cause pointer escape of the newly allocated pointer immediately after the NewAllocator callback, otherwise we ain't gonna find no leaks. Without `c++-allocator-inlining`, we only started tracking the pointer after the constructor, so this wasn't a problem. Should this be a checker-side workaround, or we should globally disable pointer escape (but not invalidation!) for this-pointer and constructor?
- Refactor other checkers that relied on `PostStmt<CXXNewExpr>`, namely `DynamicTypePropagation` and `PointerArithmeticChecker`, to use the new callback. Then see if we can remove the callback entirely, and probably re-introduce later depending on where the discussion goes.


More information about the cfe-commits mailing list