From 4eab240e259b48c7a15e2021363165cb5112dbf0 Mon Sep 17 00:00:00 2001 From: magumagu Date: Tue, 25 Mar 2014 20:48:25 -0700 Subject: [PATCH] Compute stack usage correctly in ABI_CallFunctionPC. (The numbers need to be consistent with the actual usage, or else the stack gets corrupted.) --- Source/Core/Common/x64ABI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/x64ABI.cpp b/Source/Core/Common/x64ABI.cpp index 6955a34a14..5a09201825 100644 --- a/Source/Core/Common/x64ABI.cpp +++ b/Source/Core/Common/x64ABI.cpp @@ -213,11 +213,11 @@ void XEmitter::ABI_CallFunctionCCCP(void *func, u32 param1, u32 param2,u32 param } void XEmitter::ABI_CallFunctionPC(void *func, void *param1, u32 param2) { - ABI_AlignStack(3 * 4); + ABI_AlignStack(2 * 4); PUSH(32, Imm32(param2)); PUSH(32, Imm32((u32)param1)); CALL(func); - ABI_RestoreStack(3 * 4); + ABI_RestoreStack(2 * 4); } void XEmitter::ABI_CallFunctionPPC(void *func, void *param1, void *param2,u32 param3) {