summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thunk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/Thunk.cpp')
-rw-r--r--Source/Core/Common/Src/Thunk.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/Thunk.cpp b/Source/Core/Common/Src/Thunk.cpp
index 086ad66cbb..73ad098090 100644
--- a/Source/Core/Common/Src/Thunk.cpp
+++ b/Source/Core/Common/Src/Thunk.cpp
@@ -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);