From 1271fdfaadda98339e9518762f5aeeda1492eb46 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Fri, 30 Oct 2026 13:32:11 +0800 Subject: [PATCH] [ARM64_DYNAREC] Fixed BOUND leaking a cleared deferred flags state The BOUND handler emits a conditional CALL_S() and then continues. call_c() clears df and sets dyn->f to status_none, but only on the taken path. The fall-through kept a pending df while the codegen thought it was cleared, so the stale deferred op was re-applied later and corrupted the flags. Save and restore dyn->f around that call. --- src/dynarec/arm64/dynarec_arm64_00.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c index bd9993be13..c3fa4fe265 100644 --- a/src/dynarec/arm64/dynarec_arm64_00.c +++ b/src/dynarec/arm64/dynarec_arm64_00.c @@ -37,6 +37,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin int32_t i32, tmp; int64_t i64, j64; uint8_t u8; + uint8_t f_save; uint8_t gb1, gb2, eb1, eb2; uint16_t u16; uint32_t u32; @@ -984,8 +985,10 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin B_NEXT_nocond; MARK; STORE_XEMU_CALL(xRIP); + f_save = dyn->f; CALL_S(const_native_br, -1); LOAD_XEMU_CALL(xRIP); + dyn->f = f_save; } else { INST_NAME("Illegal 62"); if(BOX64DRENV(dynarec_safeflags)>1) {