[PATCH] [analyzer][Review request] Partial fix for PR19102.

Антон Ярцев anton.yartsev at gmail.com
Wed Jun 4 17:40:44 PDT 2014


Hi jordan_rose,

Attached patch is a partial fix for PR19102. The idea is to assume the unused operator new as not a leak if the following requirement is met:
* The invoked constructor has a parameter - pointer or reference to a record that has a public method (any access level , if a constructed record is a friend of a parameter record), that accepts a pointer to the type of the constructed record or one of its bases.
The analysis can be much more precise if the analyzer can analyze the body of the constructor, but for now the criteria above can be used regardless of whether the body of the constructor is accessible to the analyzer or not.
Please review.

http://reviews.llvm.org/D4025

Files:
  lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  test/Analysis/NewDeleteLeaks-PR19102.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4025.10118.patch
Type: text/x-patch
Size: 6156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140605/d7c2ce1d/attachment.bin>


More information about the cfe-commits mailing list