www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Taking address of function literal crashes compiler

reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
This is with DMD 0.128 on Windows XP SP2.

Shortest test cases:
--
void main() {
	int f = &function() {};
}
--
void main() {
	int f = &delegate() {};
}
--

The former gives me (correctly) the error:
asdf.d(2): __funcliteral1 is not an lvalue

While the latter gives (also correctly):
asdf.d(2): __dgliteral1 is not an lvalue

Up to now, I'd say the behaviour is correct. However, after outputting
the error message Windows tells me that "dmd.exe has encountered a
problem and needs to close. We are sorry for the inconvenience. (etc)"
--- the compiler crashes completely.
Jul 13 2005
parent =?ISO-8859-15?Q?Thomas_K=FChne?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Deewiant wrote:

| This is with DMD 0.128 on Windows XP SP2.
|
| Shortest test cases:
| --
| void main() {
| 	int f = &function() {};
| }
| --
| void main() {
| 	int f = &delegate() {};
| }
| --
|
| The former gives me (correctly) the error:
| asdf.d(2): __funcliteral1 is not an lvalue
|
| While the latter gives (also correctly):
| asdf.d(2): __dgliteral1 is not an lvalue
|
| Up to now, I'd say the behaviour is correct. However, after outputting
| the error message Windows tells me that "dmd.exe has encountered a
| problem and needs to close. We are sorry for the inconvenience. (etc)"
| --- the compiler crashes completely.

Added to DStress as
http://dstress.kuehne.cn/nocompile/d/delegate_15.d
http://dstress.kuehne.cn/nocompile/f/function_03.d

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFC3CPH3w+/yD4P9tIRAlB2AJ9AEqvUmiZnWRw9nVqnjg4weCcw5gCdGE8t
JC6uGPEbg2DQ8374KpitxG4=
=vyii
-----END PGP SIGNATURE-----
Jul 18 2005