<br><br><div class="gmail_quote">On Mon, May 31, 2010 at 6:03 AM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
On May 30, 2010, at 12:46 AM, Jordy Rose wrote:<br>
<br>
</div><div class="im">> Binding a symbolic region whose type is a reference shows up when the<br>
> reference is an argument, like so:<br>
><br>
> char t3 (char& r) {<br>
>  r = 'c';<br>
>  if (r) return r;<br>
>  return '0';<br>
> }<br>
><br>
> The reason for the SymbolicRegion section in canHaveDirectBinding(),<br>
> though, was originally more about having a way to set default values by<br>
> taking advantages of a fact about SymbolicRegions (if you're accessing them<br>
> directly, it's either *p or a reference, or an explicit call to Bind()),<br>
> not enforcing a rule.<br>
<br>
</div>I don't binding directly to the SymbolicRegion is the right way to handle references.  In this case, I'd expect 'r' to evaluate to:<br>
<br>
  ElementRegion(SymbolicRegion, "char", 0)<br>
<br>
and then the binding at:<br>
<br>
  r = 'c'<br>
<br>
binds to the ElementRegion.  There's no reason to special case references.  Indeed, we should be treating them just as pointers.  Consider:<br>
<br>
  int *p = 0;<br>
  int &q = *p;<br>
  q = 1;<br>
<br>
At the assignment to 'q' we still need do a null check, an out-of-bounds check, etc.<br>
<br>
<br></blockquote><div><br>I agree to this reasoning. <br></div></div><br>