[Review, -cxx-abi microsoft] Implement proper handling of virtual destructors (single-inheritance case)

Timur Iskhodzhanov timurrrr at google.com
Tue Jan 29 09:06:42 PST 2013


2013/1/29 Timur Iskhodzhanov <timurrrr at google.com>:
> Please note that I had to change the test/CodeGenCXX/arm.cpp test
> because I believe it is wrong :)
> See the other e-mail thread for the details.
Ah, so it wasn't a new code for iOS, looks like the bug has been there
for 2.5 years already...
I'll write my reasoning here then.

arm.cpp:277 test asserts that the deleting dtor for type T returns T*,
i.e. the function type for the virtual dtor call is "T* (*dtor)()".
However, this doesn't comply with the ARM ABI which returns void (see
lib\CodeGen\ItaniumCXXABI.cpp:759)
and with the actual function implementation that returns void.

Basically, that means on ARM "delete (T*)obj;" calls "void (*dtor)()"
assuming it is "T* (*dtor)())".
I'm not sure if it can lead to real bugs in practice but the logic is
wrong and it has incorrectly failed after my change.

Does this sound like a valid reasoning?



More information about the cfe-commits mailing list