[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

wangxin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 06:31:34 PDT 2017


wangxindsb created this revision.

This implement a path-sensitive checker that warns if virtual calls are made from constructors and destructors.

The checker use the GDM (generic data map) to store three integers in the program state for constructors, destructors and objects. Once enter one of these is entered, increase the corresponding integer, once leave, decrease the corresponding integer. In a PreCall callback, the checker first check if a virtual method is called and the GDM meets the conditions, if yes, a warning will be issued.

The checker also  include a bug reporter visitor to add an extra note when the last constructor/destructor was called before the call to the virtual function.


https://reviews.llvm.org/D34275

Files:
  VirtualCallChecker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34275.102812.patch
Type: text/x-patch
Size: 19094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170616/19157c43/attachment-0001.bin>


More information about the cfe-commits mailing list