[PATCH] D43666: [analyzer] When constructing a temporary without construction context, track it for destruction anyway.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 18:14:23 PST 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet.
Herald added subscribers: cfe-commits, rnkovacs.

This brings back code that was doing so earlier (when we had no constructed contexts at all) but was removed too early in https://reviews.llvm.org/D43104, as discussed in https://reviews.llvm.org/D43497. This allows us to call the correct destructor sequence in the end of the operator `&&` in the test, even if not all of them are inlined, because we keep track of all temporaries we've constructed in order to resolve situations when the number or nature of temporaries is not known in compile-time.

The test case provided in https://reviews.llvm.org/D43497 was not entirely correct: the global variable would anyway be invalidated by the other destructor that we don't inline yet. Though, yeah, it needs to be fixed as well, but it isn't addressed by the fix that i've been thinking of (this patch).

Cleanup process misbehaves when the node after the cleanup is caching out: in this case we take the node that wasn't cleaned up and hit the assertion. This was fixed as well. It's a bit disappointing that our process of constructing a single exploded node is so complicated and error-prone.


Repository:
  rC Clang

https://reviews.llvm.org/D43666

Files:
  include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  test/Analysis/temporaries.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43666.135580.patch
Type: text/x-patch
Size: 6336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180223/5e1d46a7/attachment.bin>


More information about the cfe-commits mailing list