<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Oct 15, 2008 at 3:39 PM, 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;">
<div class="Ih2E3d"><br>
On Oct 9, 2008, at 6:45 AM, Zhongxing Xu wrote:<br>
<br>
</div><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So I suggest when we evaluate expressions, we pass on an argument indicating<br>
whether we want to get its lvalue/rvalue, instead of specifying we are getting a<br>
LVal or NonLVal.<br>
</blockquote>
<br></div>
For casts:<br>
<br>
+void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst,<br>
+                             bool asLValue) {<br>
<br>
   NodeSet S1;<br>
   QualType T = CastE->getType();<br>
<br>
-  if (T->isReferenceType())<br>
-    VisitLVal(Ex, Pred, S1);<br>
+  if (asLValue || T->isReferenceType())<br>
+    VisitLValue(Ex, Pred, S1);<br>
   else<br>
     Visit(Ex, Pred, S1);<br>
<br>
Is there a case where a cast should evaluate to an lvalue?  I don't see VisitCast called with "asLValue" being true.<br>
</blockquote></div><br>I will remove this 'asLValue'. <br></div>