September 13, 2011 Is this a bug? | ||||
---|---|---|---|---|
| ||||
Attachments:
| 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); } |
Copyright © 1999-2021 by the D Language Foundation