Is this a bug?

Jonathan M Davis jmdavisProg at gmx.com
Mon Sep 12 20:35:15 PDT 2011


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


More information about the Digitalmars-d-learn mailing list