This patch looks great. Do you have commit access? Or shall I commit it for you?<br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 1:16 PM, Jordy Rose <span dir="ltr"><<a href="mailto:jediknil@belkadan.com">jediknil@belkadan.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;">On Thu, 3 Jun 2010 12:21:09 +0800, Zhongxing Xu <<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>><br>

wrote:<br>
<div class="im">> One small suggestion: It's easier to review if each patch only solves<br>
one<br>
> specific problem. We'd like small patches that fix one well defined and<br>
> isolated problem.<br>
<br>
</div>Thanks for the correction/reminder, my mistake. (Once again it's because I<br>
did the non-dependent part second.)<br>
<div class="im"><br>
<br>
<br>
> Comments below:<br>
><br>
> Index: lib/Analysis/CFG.cpp<br>
> ===================================================================<br>
> --- lib/Analysis/CFG.cpp    (revision 105255)<br>
> +++ lib/Analysis/CFG.cpp    (working copy)<br>
> @@ -538,6 +538,15 @@<br>
>      addStmt(B->getRHS());<br>
>      return addStmt(B->getLHS());<br>
>    }<br>
> +  else if (B->isAssignmentOp()) {<br>
> +    if (asc.alwaysAdd()) {<br>
> +      autoCreateBlock();<br>
> +      AppendStmt(Block, B, asc);<br>
> +    }<br>
> +<br>
> +    addStmt(B->getRHS());<br>
><br>
> Is it necessary to add all RHS of assignment expr as block-level expr?<br>
<br>
</div>Ah. No, probably not. I was trying to imitate the default VisitStmt()<br>
behavior and change things as little as possible, but I must have gotten<br>
addStmt() and Visit() crossed in my mind. I'm not even sure the LHS needs<br>
to be addStmt()ed.<br>
<br>
Just so my understanding is clear: addStmt() / "always add" is only for<br>
statements that affect control-flow, correct?<br>
<br>
Revised patch attached, just for the crasher on "ref() = 0". Per advice<br>
I'll re-submit the second one once the first one's committed.<br>
<font color="#888888"><br>
Jordy</font></blockquote></div><br>