diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2018-01-18 00:50:19 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2018-01-18 00:50:19 +0000 |
commit | 1c64e617f57297e53abc3d48bedb5a4e3375f644 (patch) | |
tree | ce44fbc7aea2a9738668de9906a1e29496f42c55 /clang/lib/StaticAnalyzer/Core/CheckerManager.cpp | |
parent | 0c79eab03d5bd5b74ee6d30d663bdf4a07764a04 (diff) | |
download | bcm5719-llvm-1c64e617f57297e53abc3d48bedb5a4e3375f644.tar.gz bcm5719-llvm-1c64e617f57297e53abc3d48bedb5a4e3375f644.zip |
[analyzer] operator new: Add a new ProgramPoint for check::NewAllocator.
Add PostAllocatorCall program point to represent the moment in the analysis
between the operator new() call and the constructor call. Pointer cast from
"void *" to the correct object pointer type has already happened by this point.
The new program point, unlike the previously used PostImplicitCall, contains a
reference to the new-expression, which allows adding path diagnostics over it.
Differential Revision: https://reviews.llvm.org/D41800
rdar://problem/12180598
llvm-svn: 322796
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CheckerManager.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CheckerManager.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp index 360004bd67e..f3de2e40500 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -488,12 +488,7 @@ namespace { void runChecker(CheckerManager::CheckNewAllocatorFunc checkFn, NodeBuilder &Bldr, ExplodedNode *Pred) { - // TODO: Does this deserve a custom program point? For now we're re-using - // PostImplicitCall because we're guaranteed to use the non-implicit - // PostStmt for the PostCall callback, because we have some sort of - // call site (CXXNewExpr) in this scenario. - ProgramPoint L = PostImplicitCall(NE->getOperatorNew(), NE->getLocStart(), - Pred->getLocationContext()); + ProgramPoint L = PostAllocatorCall(NE, Pred->getLocationContext()); CheckerContext C(Bldr, Eng, Pred, L, WasInlined); checkFn(NE, Target, C); } |