summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-01-18 00:16:25 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-01-18 00:16:25 +0000
commit342a7ac8d6419aec9a79ea4ac3c93bbb6beeba26 (patch)
tree51c050b8cd9c68f5d9acd632f19065ea8c9863d4 /clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
parent2ed0e79bb8efc3d642e3d8212e17a160f5ebb499 (diff)
downloadbcm5719-llvm-342a7ac8d6419aec9a79ea4ac3c93bbb6beeba26.tar.gz
bcm5719-llvm-342a7ac8d6419aec9a79ea4ac3c93bbb6beeba26.zip
[analyzer] MoveChecker: Add one more common resetting method, "append".
This is especially crucial for reports related to use-after-move of standard library objects. rdar://problem/47338505 Differential Revision: https://reviews.llvm.org/D56824 llvm-svn: 351500
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
index 6efa2dfbe5b..95b5ac6d1dd 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
@@ -502,9 +502,9 @@ bool MoveChecker::isStateResetMethod(const CXXMethodDecl *MethodDec) const {
std::string MethodName = MethodDec->getName().lower();
// TODO: Some of these methods (eg., resize) are not always resetting
// the state, so we should consider looking at the arguments.
- if (MethodName == "reset" || MethodName == "clear" ||
- MethodName == "destroy" || MethodName == "resize" ||
- MethodName == "shrink")
+ if (MethodName == "assign" || MethodName == "clear" ||
+ MethodName == "destroy" || MethodName == "reset" ||
+ MethodName == "resize" || MethodName == "shrink")
return true;
}
return false;
OpenPOWER on IntegriCloud