]> granicus.if.org Git - clang/commit
[analyzer] operator new: Fix memory space for the returned region.
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 17 Jan 2018 22:58:35 +0000 (22:58 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 17 Jan 2018 22:58:35 +0000 (22:58 +0000)
commit9b5dca145b68273a00f45c01856d28165fee4ccd
treed36e6910a08ade2083cdab1f6a58f29da8439744
parent8e90076e31fa52ed35bb281fda3e1bc2c15c3f53
[analyzer] operator new: Fix memory space for the returned region.

Make sure that with c++-allocator-inlining=true we have the return value of
conservatively evaluated operator new() in the correct memory space (heap).
This is a regression/omission that worked well in c++-allocator-inlining=false.

Heap regions are superior to regular symbolic regions because they have
stricter aliasing constraints: heap regions do not alias each other or global
variables.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322780 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/NewDelete-checker-test.cpp
test/Analysis/new-ctor-null.cpp [new file with mode: 0644]