]> granicus.if.org Git - clang/commit
[analyzer] Reduced the unwanted correlations between checkers living inside MallocChe...
authorAnton Yartsev <anton.yartsev@gmail.com>
Thu, 4 Apr 2013 23:46:29 +0000 (23:46 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Thu, 4 Apr 2013 23:46:29 +0000 (23:46 +0000)
commit648cb71625a2ab3164b2cacac9e9cb3d22b03bd7
tree4d407147e1b1d9b2f3fe31d1eca4eb5d80d74e2d
parentb0eb771fb5fcbbf283e357f95230adeb6570380f
[analyzer] Reduced the unwanted correlations between checkers living inside MallocChecker.cpp

This fixes an issue pointed to by Jordan: if unix.Malloc and unix.MismatchedDeallocator are both on, then we end up still tracking leaks of memory allocated by new.
Moved the guards right before emitting the bug reports to unify and simplify the logic of handling of multiple checkers. Now all the checkers perform their checks regardless of if they were enabled, or not, and it is decided just before the emitting of the report, if it should be emitted. (idea from Anna).

Additional changes:
improved test coverage for checker correlations;
refactoring: BadDealloc -> MismatchedDealloc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178814 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp [new file with mode: 0644]
test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp [new file with mode: 0644]
test/Analysis/Malloc+NewDelete_intersections.cpp [new file with mode: 0644]
test/Analysis/NewDelete+MismatchedDeallocator_intersections.cpp [new file with mode: 0644]
test/Analysis/NewDelete-checker-test.cpp