Skip to content

Calculated windows offsets are wrong when overloads are discontinuous #7

@asherkin

Description

@asherkin

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.

function formatVTable(classInfo) {

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions