summaryrefslogtreecommitdiff
path: root/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
commit9d7b5950a3507734ec7cc323bab56ee8b2e0a13d (patch)
tree0f0e782955543561554bc29c6c918288a936a547 /lib/StaticAnalyzer/Core/Store.cpp
parent1812aa02dec992389e1567803b4a18149877bc36 (diff)
downloadclang-9d7b5950a3507734ec7cc323bab56ee8b2e0a13d.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Store.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/Store.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp
index de29f0eedd..aca6e3b625 100644
--- a/lib/StaticAnalyzer/Core/Store.cpp
+++ b/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;