Is it a Bug?

Koroskin Denis 2korden at gmail.com
Wed Aug 6 04:45:08 PDT 2008


On Wed, 06 Aug 2008 12:25:43 +0400, Chris R. Miller  
<lordSaurontheGreat at gmail.com> wrote:

> Vladimir Panteleev wrote:
>> On Wed, 06 Aug 2008 08:29:44 +0300, Chris R. Miller
>> <lordSaurontheGreat at gmail.com> wrote:
>>
>>> I have code which runs when built by GDC on OS X, but fails
>>> spectacularly on DMD 1.030 and 1.033 on Windows.  I'm not sure what to
>>> think, since DDBG isn't working well enough to import the rest of the
>>> source files to unroll the stack far enough for me to find the  
>>> offending
>>> line and work around it.
>>
>> Here's your bug:
>>
>> 16        this(bool n,MapCoord[] p...){
>> 17            Normalized=n;
>> 18            Points=p;
>> 19        }
>>
>> DMD allocates variadic parameter arrays on the stack, so "p" (and
>> "Points") contain a slice of memory on the stack.
>>
>> Change line 18 to "Points=p.dup;" and it'll work.
>
> Wow, I didn't remember that.  Thanks, I probably would not have caught
> that bug if left to my own devices.
>

How about a bug report?



More information about the Digitalmars-d mailing list