[Issue 462] New: invalid typeinfo usage breaks dmd compiler
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed Nov 8 07:33:25 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at puremagic.com schrieb am 2006-10-26:
> http://d.puremagic.com/issues/show_bug.cgi?id=462
> import std.stdio;
> struct myobject
> {
> TypeInfo objecttype;
> void * offset;
> }
>
> myobject[] list;
> class
> off
> {
> int i;
> int j;
> void setserial()
> {
> list.length=list.length+1;
> list[list.length-1].typeinfo=i.typeinfo; // this
> breaks dmd
> list[list.length-1].objecttype=typeid(typeof(i));
>
> list[list.length-1].offset=cast(void*)((cast(void*)(&i))-(cast(void*)this));
> list.length=list.length+1;
> list[list.length-1].objecttype=typeid(typeof(j));
>
> list[list.length-1].offset=cast(void*)((cast(void*)(&j))-(cast(void*)this));
> }
> }
> void main()
> {
> off a=new off;
> a.setserial();
> // serial(b);
>
> }
Added to DStress as
http://dstress.kuehne.cn/nocompile/t/typeinfo_02_A.d
http://dstress.kuehne.cn/nocompile/t/typeinfo_02_B.d
http://dstress.kuehne.cn/nocompile/t/typeinfo_02_C.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFUfnaLK5blCcjpWoRArwVAJ9j/S+qdSRA6XgJ7CA87D6iS4qoigCeOew3
eQxWdU3UGN7g3Vp28k9yS3Q=
=Bwb+
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list