From 302b5797796d655ae4e3c0270a955dd64ecb799c Mon Sep 17 00:00:00 2001 From: Stefanos Costa Date: Sat, 1 Aug 2026 22:59:51 +0300 Subject: [PATCH] loader: zero unresolved scalar floating-point returns Extracted from 3db2b3c5c5e1a26a861df7ebcacd9ccb8c484420 in KytyPS5/KytyPS5#147. --- src/loader/runtimeLinker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/loader/runtimeLinker.cpp b/src/loader/runtimeLinker.cpp index 529b89b..a1aac7e 100644 --- a/src/loader/runtimeLinker.cpp +++ b/src/loader/runtimeLinker.cpp @@ -148,7 +148,7 @@ static bool PatchGuestMemory64(uint64_t vaddr, uint64_t value) { } static uint64_t AllocateUnresolvedImportThunk(uint64_t record_id) { - constexpr uint64_t thunk_size = 162; + constexpr uint64_t thunk_size = 165; if (g_unresolved_stub_thunk_pages.empty() || g_unresolved_stub_thunk_offset + thunk_size > UNRESOLVED_STUB_PAGE_SIZE) { @@ -254,6 +254,10 @@ static uint64_t AllocateUnresolvedImportThunk(uint64_t record_id) { emit(0x41); emit(0xff); emit(0xe3); // jmp r11 + // Match the integer fallback for floating-point return values. + emit(0x0f); + emit(0x57); + emit(0xc0); // xorps xmm0, xmm0 emit(0x31); emit(0xc0); // xor eax, eax emit(0xc3); // ret