<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 11 March 2013 05:46, deadalnix <span dir="ltr"><<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sunday, 10 March 2013 at 21:01:11 UTC, Walter Bright wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
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>
</blockquote>
<br>
</div></div><a href="http://d.puremagic.com/issues/show_bug.cgi?id=9685" target="_blank">http://d.puremagic.com/issues/<u></u>show_bug.cgi?id=9685</a><br>
<br>
Isn't it an already known bug ?<br>
</blockquote></div><br><br></div><div class="gmail_extra">Works on gdc. :o)<br></div><div class="gmail_extra"><br clear="all"><br>-- <br>Iain Buclaw<br><br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>