272 – foreach inside anonymous function crashes dmd.exe

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 272 - foreach inside anonymous function crashes dmd.exe
Summary: foreach inside anonymous function crashes dmd.exe
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2006年07月29日 21:19 UTC by Serg Kovrov
Modified: 2014年02月15日 13:22 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Serg Kovrov 2006年07月29日 21:19:16 UTC
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 Walter Bright 2006年08月11日 19:17:04 UTC
Fixed DMD 0.164
Comment 2 Thomas Kühne 2006年08月14日 06:50:38 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail@puremagic.com 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-----


AltStyle によって変換されたページ (->オリジナル) /