From f338a562e9cded7bfe045de38c9ca79160bdda83 Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 6 Oct 2022 19:39:18 +0000 Subject: [PATCH] sh2 drc, fix bug in jump patching for arm64 --- cpu/drc/emit_arm.c | 3 ++- cpu/drc/emit_arm64.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu/drc/emit_arm.c b/cpu/drc/emit_arm.c index 48c39370..07324994 100644 --- a/cpu/drc/emit_arm.c +++ b/cpu/drc/emit_arm.c @@ -1188,8 +1188,9 @@ static inline void emith_pool_adjust(int tcache_offs, int move_offs) #define emith_jump_patch_size() 4 #define emith_jump_at(ptr, target) do { \ + u32 *ptr_ = (u32 *)ptr; \ u32 val_ = (u32 *)(target) - (u32 *)(ptr) - 2; \ - EOP_C_B_PTR(ptr, A_COND_AL, 0, val_ & 0xffffff); \ + EOP_C_B_PTR(ptr_, A_COND_AL, 0, val_ & 0xffffff); \ } while (0) #define emith_jump_at_size() 4 diff --git a/cpu/drc/emit_arm64.c b/cpu/drc/emit_arm64.c index cb2546dc..d61bab2a 100644 --- a/cpu/drc/emit_arm64.c +++ b/cpu/drc/emit_arm64.c @@ -1106,8 +1106,9 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode) #define emith_jump_patch_size() 4 #define emith_jump_at(ptr, target) do { \ + u32 *ptr_ = (u32 *)ptr; \ u32 disp_ = (u8 *)target - (u8 *)ptr; \ - EMIT_PTR(ptr, A64_B(disp_ & 0x0fffffff)); \ + EMIT_PTR(ptr_, A64_B(disp_ & 0x0fffffff)); \ } while (0) #define emith_jump_at_size() 4 -- 2.39.5