<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 24, 2010, at 1:21 AM, Marcin Swiderski wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Modified: cfe/trunk/lib/Analysis/CFG.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=117220&r1=117219&r2=117220&view=diff">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>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>Ted</div></body></html>