March 11, 2013 Re: Likely closure memory corruption | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 3/10/2013 10:46 PM, deadalnix wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=9685
>
> Isn't it an already known bug ?
If that's it, then good.
|
March 11, 2013 Re: Likely closure memory corruption | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright Attachments:
| On 10 March 2013 21:01, Walter Bright <newshound2@digitalmars.com> wrote: > On 3/8/2013 8:25 AM, deadalnix wrote: > >> I have a struct. The struct have a context pointer. I have this method : >> >> @property >> auto save() inout { >> return inout(Lexer)(t, r.save, line, index); >> } >> >> The context pointer IS NOT COPIED. >> >> Fixed it that way : >> >> @property >> auto save() inout { >> // XXX: dmd bug, context pointer isn't copied properly >> // doing it manualy using black magic. >> // Context pointer is the last element of the struct. Here in >> position 9. >> auto ret = inout(Lexer)(t, r.save, line, index); >> (cast(void**) &ret)[9] = (cast(void**) &this)[9]; >> >> return ret; >> } >> > > 1. We can't do anything with code snippets like that. A complete, compilable example is necessary. > > 2. Such bug reports, along with the complete example demonstrating it, needs to go into bugzilla, not here. > > 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. Thanks -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
March 11, 2013 Re: Likely closure memory corruption | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix Attachments:
| On 11 March 2013 05:46, deadalnix <deadalnix@gmail.com> wrote: > On Sunday, 10 March 2013 at 21:01:11 UTC, Walter Bright wrote: > >> On 3/8/2013 8:25 AM, deadalnix wrote: >> >>> I have a struct. The struct have a context pointer. I have this method : >>> >>> @property >>> auto save() inout { >>> return inout(Lexer)(t, r.save, line, index); >>> } >>> >>> The context pointer IS NOT COPIED. >>> >>> Fixed it that way : >>> >>> @property >>> auto save() inout { >>> // XXX: dmd bug, context pointer isn't copied properly >>> // doing it manualy using black magic. >>> // Context pointer is the last element of the struct. Here in >>> position 9. >>> auto ret = inout(Lexer)(t, r.save, line, index); >>> (cast(void**) &ret)[9] = (cast(void**) &this)[9]; >>> >>> return ret; >>> } >>> >> >> 1. We can't do anything with code snippets like that. A complete, compilable example is necessary. >> >> 2. Such bug reports, along with the complete example demonstrating it, needs to go into bugzilla, not here. >> > > http://d.puremagic.com/issues/**show_bug.cgi?id=9685<http://d.puremagic.com/issues/show_bug.cgi?id=9685> > > Isn't it an already known bug ? > Works on gdc. :o) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
Copyright © 1999-2021 by the D Language Foundation