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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 370 - Compiler stack overflow on recursive typeof in function declaration.
Summary: Compiler stack overflow on recursive typeof in function declaration.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P3 regression
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code, patch
Depends on:
Blocks: 371
Show dependency tree / graph
Reported: 2006年09月26日 07:21 UTC by Bruno Medeiros
Modified: 2014年02月15日 13:19 UTC (History)
2 users (show)

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 Bruno Medeiros 2006年09月26日 07:21:26 UTC
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 Thomas Kühne 2006年09月29日 03:20:40 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail@puremagic.com 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 Walter Bright 2006年10月04日 19:57:36 UTC
Fixed DMD 0.168
Comment 3 Robert Clipsham 2009年11月07日 07:56:57 UTC
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 Don 2009年11月07日 15:11:14 UTC
The regression occurred in DMD1.047. It worked fine in 1.046.
Comment 5 Don 2009年11月17日 06:39:09 UTC
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 Walter Bright 2009年12月06日 00:48:59 UTC
Fixed dmd 1.053


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