From 5bf74b5f044162474027897a2d2712ffb6530c9b Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 16 May 2021 21:46:10 +0100 Subject: [PATCH] reg_alloc: Determine size of spill slot with sizeof --- src/backend/x64/reg_alloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/x64/reg_alloc.cpp b/src/backend/x64/reg_alloc.cpp index 70632035..07fec2ee 100644 --- a/src/backend/x64/reg_alloc.cpp +++ b/src/backend/x64/reg_alloc.cpp @@ -714,7 +714,7 @@ Xbyak::Address RegAlloc::SpillToOpArg(HostLoc loc) { ASSERT_MSG(i < SpillCount, "Spill index greater than number of available spill locations"); using namespace Xbyak::util; - return xword[rsp + reserved_stack_space + ABI_SHADOW_SPACE + offsetof(StackLayout, spill) + i * sizeof(u64) * 2]; + return xword[rsp + reserved_stack_space + ABI_SHADOW_SPACE + offsetof(StackLayout, spill) + i * sizeof(StackLayout::spill[0])]; } } // namespace Dynarmic::Backend::X64