mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
Fixed ProtectFunction(): it should copy parameters using the padded size. Actually, I am not sure this function is correct, but at least its implementation is now equivalent to the original (before rev 439).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@441 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6d53aaed21
commit
cf36d4ba58
3 changed files with 24 additions and 14 deletions
|
@ -137,9 +137,10 @@ void *ProtectFunction(void *function, int num_params)
|
|||
// trickery : we simply re-push the parameters. might not be optimal, but that doesn't really
|
||||
// matter.
|
||||
ABI_AlignStack(num_params * 4);
|
||||
unsigned int alignedSize = ABI_GetAlignedFrameSize(num_params * 4);
|
||||
for (int i = 0; i < num_params; i++) {
|
||||
// ESP is changing, so we do not need i
|
||||
PUSH(32, MDisp(ESP, num_params * 4));
|
||||
PUSH(32, MDisp(ESP, alignedSize - 4));
|
||||
}
|
||||
CALL(function);
|
||||
ABI_RestoreStack(num_params * 4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue