[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)
commit1084de520b6145cabf32bc8f2676b56fd58ecd72
treed421d24217cd20f26b4d09507843ce562166e11d
parent980579504ae2d169db4f414cef59ed04a702dadd
[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

llvm-svn: 322780
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/test/Analysis/NewDelete-checker-test.cpp
clang/test/Analysis/new-ctor-null.cpp [new file with mode: 0644]