From: Florian Krohm Date: Sun, 20 Jul 2025 08:58:46 +0000 (+0000) Subject: s390x: Fix crash when constant folding is disabled (BZ 507173) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c9d639ecedbb98c01d1bbf30c43d119487ab0b4;p=thirdparty%2Fvalgrind.git 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 --git a/NEWS b/NEWS index 29e2274ea..d52bba0c2 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 08a34a5fa..1ee1696b3 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: