summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.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/CallEvent.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/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 52613186677..bd47e897c34 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -552,7 +552,7 @@ void CXXInstanceCall::getInitialStackFrameContents(
// FIXME: CallEvent maybe shouldn't be directly accessing StoreManager.
bool Failed;
- ThisVal = StateMgr.getStoreManager().evalDynamicCast(ThisVal, Ty, Failed);
+ ThisVal = StateMgr.getStoreManager().attemptDownCast(ThisVal, Ty, Failed);
assert(!Failed && "Calling an incorrectly devirtualized method");
}
OpenPOWER on IntegriCloud