From: Florian Krohm Date: Tue, 14 Jul 2026 20:35:12 +0000 (+0000) Subject: s390_amode_for_stack_pointer: Use it. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=229630d048cd42f40c629debfee839a78536c1dd;p=thirdparty%2Fvalgrind.git s390_amode_for_stack_pointer: Use it. The function was previously unused. Also fix the incorrect comment. --- diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 54a91a53c..b0888c12c 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -262,11 +262,9 @@ s390_amode_for_guest_state(Int offset) } -/* Construct an AMODE for accessing stack pointer at OFFSET. - OFFSET can be at most 3 * sizeof(VexGuestS390XState) + LibVEX_N_SPILL_BYTES - which may be too large for a B12 addressing mode. - Use a B20 amode as a fallback which will be safe for any offset. -*/ +/* Construct an AMODE for accessing the stack pointer at OFFSET. + Current offset values are small enough such that the following + implementation suffices. */ s390_amode * s390_amode_for_stack_pointer(Int offset) { @@ -276,7 +274,7 @@ s390_amode_for_stack_pointer(Int offset) if (fits_signed_20bit(offset)) return s390_amode_b20(offset, s390_hreg_stack_pointer()); - vpanic("invalid stack pointer offset"); + vpanic("stack pointer offset out of range"); } diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c index e990ec11b..a6d8d50a4 100644 --- a/VEX/priv/host_s390_isel.c +++ b/VEX/priv/host_s390_isel.c @@ -5332,7 +5332,7 @@ no_memcpy_put: doHelperCall. */ vassert(rloc.pri == RLPri_V128SpRel); vassert(addToSp == sizeof(V128)); - s390_amode* am = s390_amode_b12(rloc.spOff, s390_hreg_stack_pointer()); + s390_amode *am = s390_amode_for_stack_pointer(rloc.spOff); addInstr(env, s390_insn_load(sizeof(V128), dst, am)); add_to_SP(env, addToSp); break;