Bug 370 – Compiler stack overflow on recursive typeof in function declaration.

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-09-26T07:21:00Z
Last change time
2014-02-15T13:19:45Z
Keywords
ice-on-invalid-code, patch
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz
Blocks
371

Comments

Comment #0 by bruno.do.medeiros+deebugz — 2006-09-26T07:21:26Z
Compiler stack overflow on recursive typeof in function declaration: -------- void test( typeof(test) p) { } ---- Should give the error that test.p cannot be declared to be a function.
Comment #1 by thomas-dloop — 2006-09-29T03:20:40Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-09-26: > http://d.puremagic.com/issues/show_bug.cgi?id=370 > Compiler stack overflow on recursive typeof in function declaration: > -------- > void test( typeof(test) p) { } > ---- > Should give the error that test.p cannot be declared to be a function. Added to DStress as http://dstress.kuehne.cn/dstress/compile/t/typeof_11_A.d http://dstress.kuehne.cn/dstress/nocompile/t/typeof_11_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFHNwdLK5blCcjpWoRAjGOAKCVSd+aHD5hPb7Z4Kx3FDmnQN3/lwCgqihE ZtpKXj4m4YZg9mMNrO1m23s= =eF9n -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-10-04T19:57:36Z
Fixed DMD 0.168
Comment #3 by robert — 2009-11-07T07:56:57Z
The DStress cases are failing again with dmd 1.051. % dmd nocompile/t/typeof_11_B.d nocompile/t/typeof_11_B.d(14): Error: forward reference to test dmd: mtype.c:3674: virtual void TypeTypeof::toDecoBuffer(OutBuffer*): Assertion `0' failed. zsh: abort dmd nocompile/t/typeof_11_B.d
Comment #4 by clugdbug — 2009-11-07T15:11:14Z
The regression occurred in DMD1.047. It worked fine in 1.046.
Comment #5 by clugdbug — 2009-11-17T06:39:09Z
This is caused by the addition of void TypeTypeof::toDecoBuffer(OutBuffer *buf) { assert(0); } to mtype.c. This was added in DMD1.047, but wasn't added to D2, so D2 doesn't ICE. PATCH: Just change the assert into an error message, eg: error(loc, "invalid typeof expression");
Comment #6 by bugzilla — 2009-12-06T00:48:59Z
Fixed dmd 1.053