http://d.puremagic.com/issues/show_bug.cgi?id=6137
Summary: [CTFE] Foreach on semantically wrong initialized array crashes the compiler Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: timon.g...@gmx.ch --- Comment #0 from timon.g...@gmx.ch 2011-06-09 16:10:04 PDT --- The following (invalid) code segfaults DMD (2.053). enum qux = foo(); int[] bar = [[]*[[]<>[]]*[]]; // can be anything that is not an int[] int foo(){ foreach(t;bar){} return 0; } void main(){} It does not matter what the initializer of bar is at long as it is not an int[]. The segmentation fault still occurs if bar is set to immutable. Compilation output: Error: static variable bar cannot be read at compile time Segmentation fault -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------