From: Florian K. <fk...@so...> - 2025-07-20 09:01:26
|
https://sourceware.org/cgit/valgrind/commit/?id=1c9d639ecedbb98c01d1bbf30c43d119487ab0b4 commit 1c9d639ecedbb98c01d1bbf30c43d119487ab0b4 Author: Florian Krohm <fl...@ei...> Date: Sun Jul 20 08:58:46 2025 +0000 s390x: Fix crash when constant folding is disabled (BZ 507173) Followup to 942a48c1d which fixed the register usage of conditional moves for s390_insn_get_reg_usage. A similar fix is needed for s390_insn_map_regs considering the case when the condition is S390_CC_NEVER. Fixes https://bugs.kde.org/show_bug.cgi?id=507173 Diff: --- NEWS | 1 + VEX/priv/host_s390_defs.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 29e2274eae..d52bba0c2f 100644 --- a/NEWS +++ b/NEWS @@ -61,6 +61,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 506910 openat2 with RESOLVE_NO_MAGICLINKS succeeds on /proc/self/exe 506930 valgrind allows SIGKILL being reset to SIG_DFL 506970 mmap needs an EBADF fd_allowed check +507173 s390x: Crash when constant folding is disabled To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 08a34a5fa9..1ee1696b30 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -1118,8 +1118,10 @@ s390_insn_map_regs(HRegRemap *m, s390_insn *insn) break; case S390_INSN_COND_MOVE: - insn->variant.cond_move.dst = lookupHRegRemap(m, insn->variant.cond_move.dst); - s390_opnd_RMI_map_regs(m, &insn->variant.cond_move.src); + if (insn->variant.cond_move.cond != S390_CC_NEVER) { + insn->variant.cond_move.dst = lookupHRegRemap(m, insn->variant.cond_move.dst); + s390_opnd_RMI_map_regs(m, &insn->variant.cond_move.src); + } break; case S390_INSN_LOAD_IMMEDIATE: |