Is it a Bug?
Vladimir Panteleev
thecybershadow at gmail.com
Tue Aug 5 23:40:13 PDT 2008
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.
You're welcome :)
--
Best regards,
Vladimir mailto:thecybershadow at gmail.com
More information about the Digitalmars-d
mailing list