summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-01-24 20:32:26 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-01-24 20:32:26 +0000
commit50e0372f82a7c7471e68051659a4043e1d30a9da (patch)
treef13c1ed99641eeed2fc9f8b51d61ef90d6e01bfa /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
parentf386e2b081b728b031b197e6028980b1bbcf52a3 (diff)
downloadbcm5719-llvm-50e0372f82a7c7471e68051659a4043e1d30a9da.tar.gz
bcm5719-llvm-50e0372f82a7c7471e68051659a4043e1d30a9da.zip
[analyzer] Assume that the allocated value is non-null before construction.
I.e. not after. In the c++-allocator-inlining=true mode, we need to make the assumption that the conservatively evaluated operator new() has returned a non-null value. Previously we did this on CXXNewExpr, but now we have to do that before calling the constructor, because some clever constructors are sometimes assuming that their "this" is null and doing weird stuff. We would also crash upon evaluating CXXNewExpr when the allocator was inlined and returned null and had a throw specification; this is UB even for custom allocators, but we still need not to crash. Added more FIXME tests to ensure that eventually we fix calling the constructor for null return values. Differential Revision: https://reviews.llvm.org/D42192 llvm-svn: 323370
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud