]> granicus.if.org Git - clang/commit
[analyzer] operator new: Fix callback order for CXXNewExpr.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 18 Jan 2018 00:53:50 +0000 (00:53 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 18 Jan 2018 00:53:50 +0000 (00:53 +0000)
commitfdba1f2ef691d682d045df8793c65fea9b4f8b97
treedd367344c266feef7f2cd156f291282d5f1db220
parent5b43bb5e18c4748daf304e1c5ac22ae721867e06
[analyzer] operator new: Fix callback order for CXXNewExpr.

PreStmt<CXXNewExpr> was never called.

Additionally, under c++-allocator-inlining=true, PostStmt<CXXNewExpr> was
called twice when the allocator was inlined: once after evaluating the
new-expression itself, once after evaluating the allocator call which, for the
lack of better options, uses the new-expression as the call site.

This patch fixes both problems.

Differential Revision: https://reviews.llvm.org/D41934
rdar://problem/12180598

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322797 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/cxxnewexpr-callback-inline.cpp [new file with mode: 0644]
test/Analysis/cxxnewexpr-callback-noinline.cpp [new file with mode: 0644]