Where is TypeInfo_Class.m_init set

kinke kinke at libero.it
Tue Jul 31 17:12:42 UTC 2018


On Tuesday, 31 July 2018 at 01:16:29 UTC, Hakan Aras wrote:
> I was hoping it would be possible without tinkering with the 
> compiler, but it doesn't seem to be the case.

I've been playing around with LDC. There is an init symbol for 
classes, which is normally used as payload for the ClassInfo's 
m_init. I haven't been able to get its correct address though (I 
don't know enough about relocations), but it looks as if it could 
be gotten to work this way, see https://run.dlang.io/is/ZLDCpZ. 
Remove `-betterC` to see the address discrepancy causing the 
segfault, something like:

init:   0x55dd229dc810
actual: 0x55dd229d3cf0




More information about the Digitalmars-d-learn mailing list