Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculated windows offsets are wrong when overloads are discontinuous #7

Open
asherkin opened this issue Jan 11, 2020 · 0 comments
Open

Comments

@asherkin
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant