<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Nathan,<div><br></div><div>This may already be fixed:</div><div><br></div><div><a href="http://llvm.org/viewvc/llvm-project?view=rev&revision=128557">http://llvm.org/viewvc/llvm-project?view=rev&revision=128557</a></div><div><br></div><div>What version of the analyzer are you using?</div><div><br></div><div>Ted</div><div><br><div><div><div>On Apr 5, 2011, at 6:02 PM, Nathan Herring wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Ran into cases running the clang analyzer against some of my code<br>where an otherwise uninitialized local is initialized by a function<br>call or method call, but clang doesn't realize and reports the next<br>access as uninitialized or garbage. This appears to have at least one<br>representative bug, 9283.<br><br>I'm new to clang, having just gotten an enlistment and source indexing<br>yesterday, and would like to help work toward contributing a patch to<br>fix this (and learn the ropes along the way).<br><br>I've found the checker involved in CallAndMessageChecker.cpp, but this<br>appears to be downstream of the problem (not setting the value of the<br>SVal to something other than uninitialized). I've found<br>ExprEngine::VisitCall and VisitCXXMemberCallExpr, which is probably<br>the top of the world where I'd look at function arguments and look for<br>pointers to non-const Ts and non-const T references and make them<br>potential binds. Sound good so far? Next -- how do you know whether<br>the value will be set in the function call? Can we make it more<br>explicit by annotating the function arguments with something akin to<br>SAL's __out? Or does this walk down the AST into the call and sees if<br>the child (or its child, etc., etc.) do the right thing?<br><br>I've leafed through some of the Doxygen content for clang and the<br>InternalsManual page, but haven't seen exactly how this would play<br>out. Any pointers would be helpful!<br><br>Thx in advance,<br>nh<br>_______________________________________________<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></div></blockquote></div><br></div></div></body></html>