This is an archive of the discontinued LLVM Phabricator instance.

[CFG] [analyzer] Work around a disappearing CXXBindTemporaryExpr.
ClosedPublic

Authored by NoQ on Mar 27 2018, 1:48 PM.

Details

Summary

This is a CFG-side patch for the weird AST i encountered in http://lists.llvm.org/pipermail/cfe-dev/2018-March/057398.html . The omission of the CXXBindTemporaryExpr causes a crash because it produces an unexpected construction context for a temporary object that requires non-trivial destruction.

I removed the crashing assertion for now, together with the ill-formed construction context. Temporary destructor is still missing from the CFG in this case, so it was important to remove the construction context, so that not to try modeling the constructor when the destructor is completely missing.

CodeGen works fine because they defensively destroy everything they ever wanted to destroy at ExprWithCleanups.

Diff Detail

Event Timeline

NoQ created this revision.Mar 27 2018, 1:48 PM

LGTM with a nit, provided a proper fix can not be landed in a timely enough matter.

lib/Analysis/CFG.cpp
740

auto

This revision is now accepted and ready to land.Mar 30 2018, 10:43 AM
NoQ updated this revision to Diff 140464.Mar 30 2018, 12:02 PM

Use auto.

NoQ marked an inline comment as done.Mar 30 2018, 12:02 PM
This revision was automatically updated to reflect the committed changes.