<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 28, 2014, at 9:35 , Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Jordan,<div><br></div><div>I have looked into the remaining problems today; let me quickly summarize so we make sure we're on the same page.</div><div>There are basically 2 problems left:</div><div>1. The invariant</div>
<div>As you mentioned on the rollback CL, the current layout of the CFG regarding temporary destructors violates the invariants assumed by other parts of the analyzer: namely, a CFG block with a terminator must not be empty.</div>
<div>After looking into it, I fully agree that we need a principled solution here; the question is: do we want to keep the invariant, and fix the CFG with temporary destructors to match the invariant, or do we want to say the invariant doesn't hold, and we should fix the rest of the code to not assume that invariant (and work with the current layout)? (I don't even know whether the former is possible theoretically).</div>
<div>Any hints on what your gut tells you the right solutions is would be helpful, and minimize dead-ends ;)</div><div>How would you want the CFG to look here?</div></div></blockquote><div><br></div><div>I'm not actually sure why we care that a CFG block with a terminator is not empty. It might be because we expect the terminator condition to have been computed within the block, and that it's trying to catch mistakes in constructing the CFG. The possible things that could be relying on this:</div><div><br></div><div>- maybe we ask for the first CFGElement unilaterally if the block isn't the entrance or exit block</div><div>- worse, maybe we assume the block <i>is</i> the entrance or exit block if it's "empty" (since the terminator isn't included in the element count)</div><div>- other things I haven't thought of</div><div><br></div><div>But really I don't think this is an important invariant, and if the right solution to (2) involves removing it, then so be it.</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div><br></div><div>2. Taking all the correct branches</div>
<div>So far I'm not sure I have seen a case where we're not running into (1), but I'm not sure (the case where the temporary with the no-return dtor is the last in a sequence of binary logical ops seems to be (1) at least).</div>
<div>The correct solution seems to be to add tracking lifetime of temporaries in conditionals correctly. alexmc is working on a patch here.</div></div></blockquote><br></div><div>I agree; it's the particular value of "correctly" that makes the problem difficult. ;-) Very glad Alex has been able to spend time on this.</div><div><br></div><div>Jordan</div><br></body></html>