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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 9 06:14:19 PST 2018


xazax.hun added a comment.

Do you have a plan for the new false negatives when `c++-allocator-inlining` is on? Should the user mark allocation functions with attributes?

Also, I was wondering if it would make sense to only have the PostCall callback return the casted memory region in these specific cases instead of introducing a new callback.

Otherwise looks good.



================
Comment at: lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp:143
+  /// \param Target The allocated region, casted to the class type.
+  void checkNewAllocator(const CXXNewExpr *NE, SVal Target,
+                         CheckerContext &) const {}
----------------
Is it possible to have a `NonLoc` Target? If no, would it be better to make it `Loc` type?


https://reviews.llvm.org/D41406





More information about the cfe-commits mailing list