Hello,
I've tried multiple things that I use for my vtable calling function but it seems like the compiler can't simply do "call eax".
Code I use for calling:
M::VFunc<void(__stdcall*)(IMaterial*, OverrideType_t)>(this, 1)(newMaterial, 0);
VFunc:
template <class T>
static __forceinline T VFunc(void* pThis, int iIndex)
{
return reinterpret_cast<T>(GetPointerFromVTable(pThis, iIndex));
}
How it looks like in ASM after compilation:
How it should actually looks like:
Since the error is obvious with the storing variable in [ebp - xx] because after push it moves all stuff but the compiler still thinks the call will be still there. And I don't see the point why the compiler doesn't generate straight up "call eax" when it will never touch eax...
I tried changing optimization settings, C++ versions, etc... Nothing change.
Any help will be appreciated.

