Bug 272 – foreach inside anonymous function crashes dmd.exe

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-07-29T21:19:00Z
Last change time
2014-02-15T13:22:13Z
Assigned to
bugzilla
Creator
reg4dyh

Comments

Comment #0 by reg4dyh — 2006-07-29T21:19:16Z
Using foreach in anonymous function body crases dmd.exe due some assertion failure. ------------------------------------------------------- import std.stdio; alias void function(char[][char[]]) FN; int main(char[][] args) { FN fn = function(char[][char[]] aarray) { foreach (char[] s; aarray){}; // <- here }; char[][char[]] aarray; aarray["a"] = "b"; fn(aarray); return 0; }
Comment #1 by bugzilla — 2006-08-11T19:17:04Z
Fixed DMD 0.164
Comment #2 by thomas-dloop — 2006-08-14T06:50:38Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-07-30: > http://d.puremagic.com/issues/show_bug.cgi?id=272 > Using foreach in anonymous function body crases dmd.exe due some assertion > failure. > ------------------------------------------------------- > import std.stdio; > alias void function(char[][char[]]) FN; > int main(char[][] args) > { > FN fn = function(char[][char[]] aarray) > { > foreach (char[] s; aarray){}; // <- here > }; > char[][char[]] aarray; > aarray["a"] = "b"; > fn(aarray); > return 0; > } Added to DStress as http://dstress.kuehne.cn/run/f/foreach_36_A.d http://dstress.kuehne.cn/run/f/foreach_36_B.d http://dstress.kuehne.cn/run/f/foreach_36_C.d http://dstress.kuehne.cn/run/f/foreach_36_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFE4GNzLK5blCcjpWoRAoFpAJ0TuRKLUwXmSRiMEvGk6sUSyMJNjQCeKf7j NGVE1DrMCrebjNCtkLtXomM= =KEbt -----END PGP SIGNATURE-----