Calculated windows offsets are wrong when overloads are discontinuous
asherkin opened this issue · comments
Erin commented
Linux:
CForward::PushCell(int)
CForward::PushCellByRef(int *,int)
CForward::PushFloat(float)
CForward::PushFloatByRef(float *,int)
CForward::PushArray(int *,uint,int)
CForward::PushString(char const*)
CForward::PushStringEx(char *,uint,int,int)
CForward::Cancel(void)
CForward::~CForward()
CForward::~CForward()
CForward::GetForwardName(void)
CForward::GetFunctionCount(void)
CForward::GetExecType(void)
CForward::Execute(int *,SourceMod::IForwardFilter *)
CForward::RemoveFunction(SourcePawn::IPluginFunction *)
CForward::RemoveFunctionsOfPlugin(SourceMod::IPlugin *)
CForward::AddFunction(SourcePawn::IPluginFunction *)
CForward::AddFunction(SourcePawn::IPluginContext *,uint)
CForward::RemoveFunction(SourcePawn::IPluginContext *,uint)
Windows:
CForward::PushCell(int)
CForward::PushCellByRef(int *,int)
CForward::PushFloat(float)
CForward::PushFloatByRef(float *,int)
CForward::PushArray(int *,uint,int)
CForward::PushString(char const *)
CForward::PushStringEx(char *,uint,int,int)
CForward::Cancel(void)
CForward::`scalar deleting destructor'(uint)
CForward::GetForwardName(void)
CForward::GetFunctionCount(void)
CForward::GetExecType(void)
CForward::Execute(int *,SourceMod::IForwardFilter *)
CForward::RemoveFunction(SourcePawn::IPluginContext *,uint)
CForward::RemoveFunction(SourcePawn::IPluginFunction *)
CForward::RemoveFunctionsOfPlugin(SourceMod::IPlugin *)
CForward::AddFunction(SourcePawn::IPluginContext *,uint)
CForward::AddFunction(SourcePawn::IPluginFunction *)
The logic in formatVTable
only looks at the previous function (in Linux order) when fixing up the overload order for Windows, but MSVC has moved the RemoveFunction
overload from the end to be next to the other overload.
Line 351 in 0455af6
The solution is probably to pre-process the vtable to "move" the overloads together, as that looks like it would make the existing logic produce the correct result.