]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Fix crash when constant folding is disabled (BZ 507173)
authorFlorian Krohm <flo2030@eich-krohm.de>
Sun, 20 Jul 2025 08:58:46 +0000 (08:58 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Sun, 20 Jul 2025 08:58:46 +0000 (08:58 +0000)
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

NEWS
VEX/priv/host_s390_defs.c

diff --git a/NEWS b/NEWS
index 29e2274eaebfb1e68d2df0850a1491d0f9022872..d52bba0c2f534477c7fd903c880118107e9b0121 100644 (file)
--- 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
index 08a34a5fa9ff1cd25e19edf3de7210526d8e2dd3..1ee1696b301db8dbe691d5360a927a08aa98ddae 100644 (file)
@@ -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: