summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-07-21 23:42:31 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-07-21 23:42:31 +0000
commitf57f90dfd1c328fc8bb9d9009be0b7690a7bd761 (patch)
tree5a1492613ac13a456f4b016e80e4c623c9bd957f /clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
parentc107a4875e40d0aceb6f542803fc71e0cfe86e46 (diff)
downloadbcm5719-llvm-f57f90dfd1c328fc8bb9d9009be0b7690a7bd761.tar.gz
bcm5719-llvm-f57f90dfd1c328fc8bb9d9009be0b7690a7bd761.zip
[analyzer] Add checker modeling potential C++ self-assignment
This checker checks copy and move assignment operators whether they are protected against self-assignment. Since C++ core guidelines discourages explicit checking for `&rhs==this` in general we take a different approach: in top-frame analysis we branch the exploded graph for two cases, where &rhs==this and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the work. It is important that we check all copy and move assignment operator in top frame even if we checked them already since self-assignments may happen undetected even in the same translation unit (e.g. using random indices for an array what may or may not be the same). This reapplies r275820 after fixing a string-lifetime issue discovered by the bots. A patch by Ádám Balogh! Differential Revision: https://reviews.llvm.org/D19311 llvm-svn: 276365
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
index 62ccc3cb497..3510c510c75 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
+++ b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
@@ -22,6 +22,7 @@ add_clang_library(clangStaticAnalyzerCheckers
CheckerDocumentation.cpp
ChrootChecker.cpp
ClangCheckers.cpp
+ CXXSelfAssignmentChecker.cpp
DeadStoresChecker.cpp
DebugCheckers.cpp
DereferenceChecker.cpp
OpenPOWER on IntegriCloud