summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/Store.cpp
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2016-08-08 09:22:59 +0000
committerGabor Horvath <xazax.hun@gmail.com>2016-08-08 09:22:59 +0000
commit44583ce65a81c4e6e4e629d259e9e2851c0c6e6e (patch)
tree6ad1d0715baa7d4fb8d032eb2dbb35204aaea89d /clang/lib/StaticAnalyzer/Core/Store.cpp
parent2ab623b5a31db5fecb08f822cc59433cfb7ccb58 (diff)
downloadbcm5719-llvm-44583ce65a81c4e6e4e629d259e9e2851c0c6e6e.tar.gz
bcm5719-llvm-44583ce65a81c4e6e4e629d259e9e2851c0c6e6e.zip
[analyzer] Model base to derived casts more precisely.
Dynamic casts are handled relatively well by the static analyzer. BaseToDerived casts however are treated conservatively. This can cause some false positives with the NewDeleteLeaks checker. This patch alters the behavior of BaseToDerived casts. In case a dynamic cast would succeed use the same semantics. Otherwise fall back to the conservative approach. Differential Revision: https://reviews.llvm.org/D23014 llvm-svn: 277989
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Store.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/Store.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp
index de29f0eedd1..aca6e3b6255 100644
--- a/clang/lib/StaticAnalyzer/Core/Store.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Store.cpp
@@ -292,7 +292,7 @@ static const CXXRecordDecl *getCXXRecordType(const MemRegion *MR) {
return nullptr;
}
-SVal StoreManager::evalDynamicCast(SVal Base, QualType TargetType,
+SVal StoreManager::attemptDownCast(SVal Base, QualType TargetType,
bool &Failed) {
Failed = false;
OpenPOWER on IntegriCloud