Fix detour of functions returning a float
Floats are always returned in FPU register st0. Since the value in st0 doesn't matter in a pre-hook before the function was executed, don't try to save and restore the value of the FPU stack top for a pre-hook. Only replace st0 after a post hook.
This commit is contained in:
@@ -387,7 +387,7 @@ ReturnAction_t HandleDetour(HookType_t hookType, CHook* pDetour)
|
||||
}
|
||||
else if (pWrapper->returnType == ReturnType_Float)
|
||||
{
|
||||
*(float *)tempRetBuf = *(float *)returnStruct->newResult;
|
||||
*(float *)&tempRetBuf = *(float *)returnStruct->newResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user