<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 March 2013 21:01, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 3/8/2013 8:25 AM, deadalnix wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a struct. The struct have a context pointer. I have this method :<br>
<br>
@property<br>
auto save() inout {<br>
     return inout(Lexer)(t, r.save, line, index);<br>
}<br>
<br>
The context pointer IS NOT COPIED.<br>
<br>
Fixed it that way :<br>
<br>
@property<br>
auto save() inout {<br>
     // XXX: dmd bug, context pointer isn't copied properly<br>
     // doing it manualy using black magic.<br>
     // Context pointer is the last element of the struct. Here in position 9.<br>
     auto ret = inout(Lexer)(t, r.save, line, index);<br>
     (cast(void**) &ret)[9] = (cast(void**) &this)[9];<br>
<br>
     return ret;<br>
}<br>
</blockquote>
<br></div>
1. We can't do anything with code snippets like that. A complete, compilable example is necessary.<br>
<br>
2. Such bug reports, along with the complete example demonstrating it, needs to go into bugzilla, not here.<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Agreed.  Can you also raise a bug for that failing gdc case.  I'm in the middle of improving the custom static chain passing code in gdc, and want to try and stamp out as much as possible in the process.<br>
<br><br clear="all"></div><div class="gmail_extra">Thanks<br></div><div class="gmail_extra">-- <br>Iain Buclaw<br><br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>