<div dir="ltr"><br><br>
<div class="gmail_quote">On Sat, Oct 18, 2008 at 12:15 PM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Author: kremenek<br>Date: Fri Oct 17 23:15:35 2008<br>New Revision: 57761<br><br>URL: <a target="_blank" href="http://llvm.org/viewvc/llvm-project?rev=57761&view=rev">http://llvm.org/viewvc/llvm-project?rev=57761&view=rev</a><br>
Log:<br>Generalize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate temporaries, so can many other expressions.<br><br>Modified:<br> cfe/trunk/lib/Analysis/GRExprEngine.cpp<br><br>Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp<br>
URL: <a target="_blank" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57761&r1=57760&r2=57761&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57761&r1=57760&r2=57761&view=diff</a><br>
<br>==============================================================================<br>--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)<br>+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Fri Oct 17 23:15:35 2008<br>@@ -408,9 +408,6 @@<br>
}<br><br> switch (Ex->getStmtClass()) {<br>- default:<br>- Ex->dump();<br>- assert(0 && "Other kinds of expressions do not have lvalue.");<br><br> case Stmt::ArraySubscriptExprClass:<br>
VisitArraySubscriptExpr(cast<ArraySubscriptExpr>(Ex), Pred, Dst, true);<br>@@ -447,16 +444,16 @@<br> Dst.Add(Pred);<br> return;<br><br>- case Stmt::CallExprClass:<br>- case Stmt::ObjCMessageExprClass:<br>
- // Function calls and message expressions that return temporaries<br>- // that are objects can be called in this context. We need to<br>- // enhance our support of struct return values, so right now just<br>
- // do a regular visit.<br>- assert (!Ex->getType()->isIntegerType());<br>- assert (!Ex->getType()->isPointerType());<br>- Visit(Ex, Pred, Dst);<br>+ default:<br>+ // Arbitrary subexpressions can return aggregate temporaries that<br>
+ // can be used in a lvalue context. We need to enhance our support<br>+ // of such temporaries in both the environment and the store, so right</blockquote>
<div>Yes. Such enhancement is also necessary for struct assignment: </div>
<div>struct s {};</div>
<div>struct s d1;</div>
<div>d1 = foo();</div>
<div> </div>
<div>We might need to extend SVal to represent aggregate value.</div>
<div> </div>
<div>Also, temporaries are prevalent in C++. </div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><span></span><br>+ // now we just do a regular visit.<br>+ assert (Ex->getType()->isAggregateType() &&<br>
+ "Other kinds of expressions with non-aggregate types do not "<br>+ "have lvalues.");<br><br>+ Visit(Ex, Pred, Dst);<br> }<br> }<br><br><br><br>_______________________________________________<br>
cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>