Bug 650 – Assertion failure: '0' on line 774 in file 'expression.c'
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-12-05T02:13:00Z
Last change time
2014-02-15T13:22:08Z
Assigned to
bugzilla
Creator
kinaba
Comments
Comment #0 by kinaba — 2006-12-05T02:13:02Z
Feeding arrayliteral of chars (not string literals)
as a template argument causes abnormal termination of dmd.
// credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/535
template test(char[] val) {}
mixin test!(['a','b','c']); // if this is "abc" it's ok.
outputs:
global.errors = 0, gag = 0
01E27330 arrayliteral type=char[3]
Assertion failure: '0' on line 774 in file 'expression.c'
abnormal program termination
The same assertion failure also happens when
a pointer (to functions, global variables, etc) is
put into a tuple parameter:
// discovered by shinichiro.h
template T(X...) {}
void f(){}
alias T!(&f) a;
global.errors = 0, gag = 0
01E56F10 symoff type=void(*)()
Assertion failure: '0' on line 774 in file 'expression.c'
abnormal program termination
Comment #1 by thomas-dloop — 2006-12-07T05:06:13Z
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[email protected] schrieb am 2006-12-05:
> http://d.puremagic.com/issues/show_bug.cgi?id=650
> Feeding arrayliteral of chars (not string literals)
> as a template argument causes abnormal termination of dmd.
>
> // credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/535
> template test(char[] val) {}
> mixin test!(['a','b','c']); // if this is "abc" it's ok.
>
> outputs:
>
> global.errors = 0, gag = 0
> 01E27330 arrayliteral type=char[3]
> Assertion failure: '0' on line 774 in file 'expression.c'
>
> abnormal program termination
Added to DStress as
http://dstress.kuehne.cn/compile/t/template_50_A.dhttp://dstress.kuehne.cn/compile/t/template_50_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFd/yKLK5blCcjpWoRAk/9AJ9sGY+NvRH6gnE98Sh2rHItF5wehACdEUv4
ZhNcaKNF+QvBs8ffdX41/ss=
=paZ8
-----END PGP SIGNATURE-----