Is this a bug?

Caligo iteronvexor at gmail.com
Mon Sep 12 20:38:25 PDT 2011


Great. So is it a known bug?

On Mon, Sep 12, 2011 at 10:35 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Monday, September 12, 2011 22:31:33 Caligo wrote:
> > Trying to help someone on SO, I ran into problems.
> >
> > On a 64-bit Linux machine, with DMD 2.055
> >
> > This gives: '/Internal error: ../ztc/cg87.c 202'
> > void main(){
> >
> > auto f = (double m){ static double sum = 0.0; return sum += m * m; };
> > double[] a = array(map!f(iota(1.0, 25.0, 1.0)));
> > writeln(a);
> > }
> >
> >
> > This one compiles but I get Segmentation fault.
> > void main(){
> >
> > auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };
> > double[] a = array(map!f(iota(1.0, 25.0, 1.0)));
> > writeln(a);
> > }
> >
> >
> > This one compiles and runs.
> > void main(){
> >
> > auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };
> > double[] a = array(map!f(array(iota(1.0, 25.0, 1.0))));
> > writeln(a);
> > //works
> > }
> >
> >
> > Putting everything together, I still get 'Internal error: ../ztc/cg87.c
> 202'
> > with this one.
> > void main(){
> >
> > auto f = (double m){ static double sum = 0.0; return sum += m * m; };
> > double[] a = array(map!f(array(iota(1.0, 25.0, 1.0))));
> > writeln(a);
> > }
>
> It's always a bug if you see "Internal error."
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110912/bf38c2f9/attachment.html>


More information about the Digitalmars-d-learn mailing list