[PATCH] D35796: [analyzer] Misused polymorphic object checker

Reka Kovacs via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 05:53:10 PDT 2017


rnkovacs created this revision.
Herald added subscribers: baloghadamsoftware, xazax.hun, whisperity, mgorny.

This check warns if a derived type object is deleted through a base pointer with a non-virtual destructor in its base class. It also places a note at the last point where the derived-to-base conversion happened.

Corresponding CERT rule: OOP52-CPP: Do not delete a polymorphic object without a virtual destructor. <https://www.securecoding.cert.org/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor>


https://reviews.llvm.org/D35796

Files:
  include/clang/StaticAnalyzer/Checkers/Checkers.td
  lib/StaticAnalyzer/Checkers/CMakeLists.txt
  lib/StaticAnalyzer/Checkers/MisusedPolymorphicObjectChecker.cpp
  test/Analysis/MisusedPolymorphicObject.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35796.107893.patch
Type: text/x-patch
Size: 13377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170724/098960a2/attachment-0001.bin>


More information about the cfe-commits mailing list