Edit: Decided this was extra double-plus annoying and decided to quickly fix it using the first option described below.
However this has revealed that NativeBoolean/NativeChar are a bit of an annoying edge case to be handled. We should consider the second option below to make it so that we don't generally have to worry about them.
Ideally we'd use NativeBoolean for the vtable pointer but bool for the trampoline. However doing that is somewhat more complex now.
There's multiple ways to handle this and I'm not sure which I want to go with so I'm deferring this for the time being since it's not a huge deal. As a workaround I'm going to modify WrapNonBlittableTypesWhereNecessaryTransformation to always wrap bool/char on virtual methods.
Transform virtual methods to use wrappers and modify the trampoline emit to use bool/char when emitting types for the trampoline.
Remove WrapNonBlittableTypesWhereNecessaryTransformation and have the output stage responsible for wrapping bool/char instead. (If we do this, the output stage needs to know to add the wrappers or we need to move them to a support library of some kind.
Edit: Decided this was extra double-plus annoying and decided to quickly fix it using the first option described below.
However this has revealed that
NativeBoolean
/NativeChar
are a bit of an annoying edge case to be handled. We should consider the second option below to make it so that we don't generally have to worry about them.An unfortunate side-effect of https://github.com/InfectedLibraries/Biohazrd/issues/147 is that we can't use
NativeBoolean
on the vtable pointer type andbool
on the correspondingTranslatedFunction
.Ideally we'd use
NativeBoolean
for the vtable pointer butbool
for the trampoline. However doing that is somewhat more complex now.There's multiple ways to handle this and I'm not sure which I want to go with so I'm deferring this for the time being since it's not a huge deal. As a workaround I'm going to modify
WrapNonBlittableTypesWhereNecessaryTransformation
to always wrapbool
/char
on virtual methods.bool
/char
when emitting types for the trampoline.WrapNonBlittableTypesWhereNecessaryTransformation
and have the output stage responsible for wrappingbool
/char
instead. (If we do this, the output stage needs to know to add the wrappers or we need to move them to a support library of some kind.