<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Oct 17, 2008 at 8:55 AM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Author: kremenek<br>
Date: Thu Oct 16 19:55:33 2008<br>
New Revision: 57659<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=57659&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=57659&view=rev</a><br>
Log:<br>
Remove an untrue assertion: lval::FuncVals can be returned in both rvalue and lvalue contexts.</blockquote><div><br>True. In the following case we'll take g's lvalue in the first assignment, then g's rvalue with an implicitcast from function type to pointer to function type. Since we represent both as lval::FuncVals, no conversion is required for the cast.<br>
VisitCast() faithfully does this.<br><br>void g() {<br>}<br><br>void f() {<br> void (*p)();<br> p = &g;<br> p == g;<br>}<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Modified:<br>
cfe/trunk/lib/Analysis/GRExprEngine.cpp<br>
<br>
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57659&r1=57658&r2=57659&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57659&r1=57658&r2=57659&view=diff</a><br>
<br>
==============================================================================<br>
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)<br>
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Oct 16 19:55:33 2008<br>
@@ -834,8 +834,10 @@<br>
return;<br>
<br>
} else if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) {<br>
- assert(!asLValue && "FunctionDecl does not have lvalue.");<br>
-<br>
+ // We return the lval::FuncVal for an FunctionDecl in both rvalue<br>
+ // and lvalue contexts.<br>
+ // FIXME: Does this need to be revised? We were getting cases in<br>
+ // real code that did this.<br>
RVal V = lval::FuncVal(FD);<br>
MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, V));<br>
return;<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 href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>