From 2a3baa3987bfd181635886e0279028a43683e928 Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Fri, 10 Jan 2025 17:36:40 -0800 Subject: [PATCH] fixed allocate_object_on_stack() --- src/windows-emulator/windows_emulator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/windows-emulator/windows_emulator.cpp b/src/windows-emulator/windows_emulator.cpp index 52577ab1..e1f565ab 100644 --- a/src/windows-emulator/windows_emulator.cpp +++ b/src/windows-emulator/windows_emulator.cpp @@ -15,10 +15,8 @@ namespace emulator_object allocate_object_on_stack(x64_emulator& emu) { const auto old_sp = emu.reg(x64_register::rsp); - const auto new_sp = - align_down(old_sp - sizeof(CONTEXT64), std::max(alignof(CONTEXT64), alignof(x64_emulator::pointer_type))); + const auto new_sp = align_down(old_sp - sizeof(T), std::max(alignof(T), alignof(x64_emulator::pointer_type))); emu.reg(x64_register::rsp, new_sp); - return {emu, new_sp}; }