<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 12, 2013, at 7:04 PM, Sam Handler <<a href="mailto:samuel.handler+cfedev@gmail.com">samuel.handler+cfedev@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 8:43 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div></div><div><div></div></div><div></div><div></div><div></div>
<div><div></div></div><div><div></div></div><blockquote type="cite"><div><div>+If needed, the <tt>addTransition</tt> function can be called with no arguments to return the current</div>
<div>+<tt>ExplodedNode</tt> without changing the program's state.</div></div><span></span></blockquote><div><br></div><div>This isn't exactly true; addTransition returns a <i>new</i> node without changing the <i>current </i>node's state, but it does return a new node, either for emitting a bug report or just putting your stamp on whatever you are checking. If you use addTransition just to get the current node, it's all to you end up splitting the path.</div>

</div></blockquote><div><br></div><div>Calling addTransition without arguments does not in fact appear to return a new node.<br><br><font size="1"><span style="font-family:courier new,monospace">ExplodedNode *addTransition(ProgramStateRef State = 0,<br>

                            const ProgramPointTag *Tag = 0) {<br>  return addTransitionImpl(State ? State : getState(), false, 0, Tag);<br>}</span></font><br><br><font size="1"><span style="font-family:courier new,monospace">ExplodedNode *addTransitionImpl(ProgramStateRef State,<br>

                               bool MarkAsSink,<br>                               ExplodedNode *P = 0,<br>                               const ProgramPointTag *Tag = 0) {<br>  if (!State || (State == Pred->getState() && !Tag && !MarkAsSink))<br>

    return Pred;<br>  ...</span></font><br><br><br></div><div>Since getState() returns Pred->getState(), calling addTransition() is the same as calling addTransitionImpl(Pred->getState(), false, 0, 0), which will simply return Pred.<br>
<br></div></div></div></div></div></blockquote><div><br></div>Sam,</div><div><br></div><div>Thanks for drawing the attention to this. I think Jordan is right, the checker should tag the node when using it for a BugReport. Otherwise, the analyzer engine's internal node reclamation might remove the node altogether (at least in theory). I vaguely recall adding the if statement as a micro optimization. If it was not there, addTransition() would create a new tagged node.</div><div><br></div><div>I'll try taking out the if statement and see if it results in any performance regressions.</div><div><br></div><div>Thanks,</div><div>Anna.</div><div><br><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I'm not sure if this behavior is intentional, although there are many existing checkers that call addTransition with no arguments to get the ExplodedNode for a bug report.<br><br></div><div>In any case, I've changed the text to recommend getPredecessor(), as this seems like the more logical choice. I've also made it clearer that this can only be used if no state transition has been performed.<br>
</div></div><br></div><div class="gmail_extra">All other comments should be addressed.<br><br></div><div class="gmail_extra">--Sam<br></div></div><br clear="all"><br>-- <br>===============================================================================<br>
All opinions expressed in posts from this account are entirely my own, and not<br>those of any present or former employer. Furthermore, I assert that all works<br>contributed to the Clang project (1) were developed using no equipment,<br>
supplies, facility or trade secrets of any such employer, (2) were developed<br>entirely on my own time, and (3) do not result from any work performed for any<br>such employer.<br><br>
</div>
<span><checker_dev_manual.diff></span></blockquote></div><br></body></html>