GC.BlkAttr.FINALIZE

Namespace rswhite4 at googlemail.com
Mon Mar 3 09:03:12 PST 2014


On Monday, 3 March 2014 at 02:44:09 UTC, Namespace wrote:
> It's working now, I get all my debug infos I need.
> But: I have absolutly no idea how to get the correct TypeInfo 
> in rt_finalize2. The ClassInfo is identified by casting the 
> void* pointer to a void** and then cast this void** to 
> ClassInfo*. But for other TypeInfos this weird trick doesn't 
> work. How can I extract the correct TypeInfo from this void**? 
> :P

I get the real TypeInfo (not sure if this was intended this way) 
and in my test base it works! But in druntime I get the weird 
error:
src\rt\lifetime.d(1256): Error: variable a1 used before set

----
     if (gc_getAttr(p) & BlkAttr.APPENDABLE)
     {
         void[] a1 = *cast(void[]*) ppv;
         //printf("len = %d\n", a1.length);

         void* p_a1 = &a1;
         void* tp = p_a1 + 12;

         TypeInfo* ti = cast(TypeInfo*) tp;

         import std.string : toStringz;
         string s = ti.toString(); // line 1256
         printf("Type = %s\n", toStringz(s));

         return;
     }
----

Any call to ti will invoke the error. Any idea why?


More information about the Digitalmars-d-learn mailing list