HomePhabricator

[analyzer] Inline constructors for destroyable temporaries.

Description

[analyzer] Inline constructors for destroyable temporaries.

Since r325210, in cfg-temporary-dtors mode, we can rely on the CFG to tell us
that we're indeed constructing a temporary, so we can trivially construct a
temporary region and inline the constructor.

Much like r325202, this is only done under the off-by-default
cfg-temporary-dtors flag because the temporary destructor, even if available,
will not be inlined and won't have the correct object value (target region).
Unless this is fixed, it is quite unsafe to inline the constructor.

If the temporary is lifetime-extended, the destructor would be an automatic
destructor, which would be evaluated with a "correct" target region - modulo
the series of incorrect relocations performed during the lifetime extension.
It means that at least, values within the object are guaranteed to be properly
escaped or invalidated.

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

Details

Committed
dergachevFeb 14 2018, 7:26 PM
Differential Revision
D43062: [analyzer] Support CXXTemporaryObjectExpr constructors that have destructors.
Parents
rL325210: [CFG] Provide construction contexts for temproary objects.
Branches
Unknown
Tags
Unknown