[Issue 23814] [Codegen] Calling member function of extern(C++) class with multiple inheritance doesn't preserve the EBX register in some cases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 16 10:55:12 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23814

--- Comment #7 from naydef <naydef at abv.bg> ---
Hm, I don't know how to try it with a D class. The reproduction code relies on
a C++ compiler (GCC uses the EBX register right after calling D virtual
function, DMD doesn't seem to do that). Also the content of EBX is not used in
this THUNK, so nothing depends on it.

I don't understand what "register clobbering" in the question refers to. I'd
assume Walter means the correct fix is to preserve the register on THUNK entry
and restore on exit. If that's what's meant, then I don't know how to achieve
that (I'm not familiar with DMD). Also as the example shows, I see no code
relying on EBX content, instead there's a JMP to regular function, so this CALL
+ POP + ADD sequence seems redundant.

Yea, I'm welcome for better fix...

--


More information about the Digitalmars-d-bugs mailing list