]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Fix diagnostic for S390_DECODE_UNKNOWN_SPECIAL_INSN
authorFlorian Krohm <flo2030@eich-krohm.de>
Mon, 30 Jun 2025 19:31:33 +0000 (19:31 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Mon, 30 Jun 2025 19:31:33 +0000 (19:31 +0000)
When decoding fails the insn bytes (at most 6) are shown. However,
"special insns" are 10 bytes with the last 2 bytes being the interesting
ones. Print them all.

VEX/priv/guest_s390_toIR.c

index b3ee122c5a11e5d0312a39719303ad4f43cdc296..f40cd15e851bdb98128614723ea1b4dde3405589 100644 (file)
@@ -23881,12 +23881,10 @@ s390_decode_and_irgen(const UChar *bytes, UInt insn_length, DisResult *dres)
          vpanic("s390_decode_and_irgen");
       }
 
-      vex_printf("%02x%02x", bytes[0], bytes[1]);
-      if (insn_length > 2) {
-         vex_printf(" %02x%02x", bytes[2], bytes[3]);
-      }
-      if (insn_length > 4) {
-         vex_printf(" %02x%02x", bytes[4], bytes[5]);
+      for (unsigned i = 0; i < insn_length; i += 2) {
+         if (i != 0)
+            vex_printf(" ");
+         vex_printf("%02x%02x", bytes[i], bytes[i + 1]);
       }
       vex_printf("\n");
    }