<br><br><div class="gmail_quote">On Tue, Oct 26, 2010 at 6:02 AM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;"><div class="im"><br><div><div>On Oct 24, 2010, at 1:21 AM, Marcin Swiderski wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;">Modified: cfe/trunk/lib/Analysis/CFG.cpp<br>
URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=117220&r1=117219&r2=117220&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=117220&r1=117219&r2=117220&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/lib/Analysis/CFG.cpp (original)<br>+++ cfe/trunk/lib/Analysis/CFG.cpp Sun Oct 24 03:21:40 2010<br>@@ -912,15 +912,17 @@<br>      AppendStmt(Block, B, asc);<br>
    }<br><br>-    // If visiting RHS causes us to finish 'Block' and the LHS doesn't<br>-    // create a new block, then we should return RBlock.  Otherwise<br>-    // we'll incorrectly return NULL.<br>-    CFGBlock *RBlock = Visit(B->getRHS());<br>
-    CFGBlock *LBlock = Visit(B->getLHS(), AddStmtChoice::AsLValueNotAlwaysAdd);<br>-    return LBlock ? LBlock : RBlock;<br>+    Visit(B->getLHS(), AddStmtChoice::AsLValueNotAlwaysAdd);<br>+    return Visit(B->getRHS());<br>
  }</span></blockquote></div><br></div><div><div>Hi Marcin,</div><div><br></div><div>Shouldn't we invert the check that we had before?  Visit(B->getRHS()) isn't guaranteed to return a non-NULL block if visiting the LHS resulted in finishing up a CFGBlock.  That was the purpose of the previous logic (when the LHS was visited first).</div>
</div><div><br></div></div></blockquote><div><br>Only statements containing control flow could cause 'Block' to be NULL, e.g. DoStmt, WhileStmt, CastStmt. They do occur in the RHS of assignments, but they do not occur in the LHS of assignments. So I think it's safe here. Or I could miss something?<br>
</div></div>