]> granicus.if.org Git - clang/commit
[analyzer] Fix invalidation when returning into a ctor initializer.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 1 Jul 2019 23:02:18 +0000 (23:02 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 1 Jul 2019 23:02:18 +0000 (23:02 +0000)
commit6d6bd2902839421c2a5ac2bfa1db971d16692847
tree3b4455899bceaeedfcf0e423288474958fd46e8f
parent273f8722be00ef1ba622ff40ab2488a135fcbe3b
[analyzer] Fix invalidation when returning into a ctor initializer.

Due to RVO the target region of a function that returns an object by
value isn't necessarily a temporary object region; it may be an
arbitrary memory region. In particular, it may be a field of a bigger
object.

Make sure we don't invalidate the bigger object when said function is
evaluated conservatively.

Differential Revision: https://reviews.llvm.org/D63968

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