www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 462] New: invalid typeinfo usage breaks dmd compiler

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: davidl 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);

}


-- 
Oct 25 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail 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-----
Nov 08 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=462


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from deewiant gmail.com  2006-11-15 02:59 -------
Fixed in DMD 0.174.


-- 
Nov 15 2006