From 19a423034e1abcaf1a61fa61ceffffebf45a0240 Mon Sep 17 00:00:00 2001 From: Merry Date: Sat, 26 Feb 2022 16:09:11 +0000 Subject: [PATCH] block_of_code: Fix inaccurate size reporting in SpaceRemaining Typo: getCode should be getCurr: Instead of comparing against the current pointer, we were incorrectly comparing against the start of memory --- src/dynarmic/backend/x64/block_of_code.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dynarmic/backend/x64/block_of_code.cpp b/src/dynarmic/backend/x64/block_of_code.cpp index 3120cf47..42e15fc7 100644 --- a/src/dynarmic/backend/x64/block_of_code.cpp +++ b/src/dynarmic/backend/x64/block_of_code.cpp @@ -190,8 +190,8 @@ void BlockOfCode::ClearCache() { size_t BlockOfCode::SpaceRemaining() const { ASSERT(prelude_complete); - const u8* current_near_ptr = in_far_code ? reinterpret_cast(near_code_ptr) : getCode(); - const u8* current_far_ptr = in_far_code ? getCode() : reinterpret_cast(far_code_ptr); + const u8* current_near_ptr = in_far_code ? reinterpret_cast(near_code_ptr) : getCurr(); + const u8* current_far_ptr = in_far_code ? getCurr() : reinterpret_cast(far_code_ptr); if (current_near_ptr >= far_code_begin) return 0; if (current_far_ptr >= &top_[maxSize_])