[Issue 462] New: invalid typeinfo usage breaks dmd compiler
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 25 22:54:59 PDT 2006
http://d.puremagic.com/issues/show_bug.cgi?id=462
Summary: invalid typeinfo usage breaks dmd compiler
Product: D
Version: 0.172
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: davidl at 126.com
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);
}
--
More information about the Digitalmars-d-bugs
mailing list