<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 6, 2012, at 1:55 AM, Zong wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"> Dear All,<br><br>I have a very simple clang analyzer checker code snippet like below,<br><br>--------------------------------------------------<br>using namespace clang;<br>using namespace ento;<br><br>namespace {<br>  class myChecker: public Checker< check::PreStmt<Stmt> >  {<br>  public:<br>    void checkPreStmt(const Stmt *S, CheckerContext &Ctx) const ;<br><br>  };<br>}<br><br>void myChecker::checkPreStmt(const Stmt *S, CheckerContext &Ctx) const {<br>   S->dumpAll();<br>}<br>--------------------------------------------------<br><br>This analyzer was then fed with the test code:<br><br>int main()<br>{<br>  int *b;<br>  int *c;<br>  *c=b;<br>   return 0;<br>}<br><br>Why can't I observe a "ReturnStmt"? <br>If I change "*c=b" with something other (e.g., b=c), then "ReturnStmt" appears.  I just can!
 't figure out the reason. Would someone please help me ? Thanks!<br><br></div></blockquote><div><div><br></div><div>What is the command line you use to execute this? </div><div><br></div><div>Could it be because '*c=b' causes "Dereference of undefined pointer value" error (in another checker)? Most analyzer errors are defined as sinks - it means that we stop analyzing the path after such error is caught. (This example also produces a compiler warning - you are casting 'int *' to 'int'.)</div><div><br></div><div>Anna.</div></div></div><div><br></div><div><blockquote type="cite"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Best,<br>Z<br></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>