<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This patch looks really awesome. The only problem I see is that VisitDeclStmt doesn't handle the fact that a local variable is uninitialized before VisitDeclStmt is called (this poses a problem because the Expr* for the initializer is visited before the DeclStmt). That's why local variables are initialized to UndefinedVal. Observe that the test case Analysis/uninit-ps-rdar6145427.m fails because of this change (run 'make test').<br>
<br>
I think the solution is to leave in:<br>
<br>
RVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||<br>
isa<ImplicitParamDecl>(VD))<br>
? RVal::GetSymbolValue(SymMgr, VD)<br>
: UndefinedVal();<br>
<br>
instead of:<br>
<br>
// Only handle globals and parameters here. Local variables are handled<br>
// in VisitDeclStmt().<br>
if (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||<br>
isa<ImplicitParamDecl>(VD)) {<br>
RVal X = RVal::GetSymbolValue(StateMgr.getSymbolManager(), VD);<br>
St = SetRVal(St, lval::DeclVal(VD), X);<br>
}<br>
<font color="#888888">Ted</font></blockquote><div><br>New patch is attached. <br></div></div><br></div>