From ec0c87aebf6b56d582b63d873e55a4274b0b6b41 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Thu, 6 Mar 2025 18:39:26 +0000 Subject: [PATCH] s390x: Fix VLRL and VSTRL insns (Bug 498422) The replacement field for these insns is 12-bit wide. So its value cannot possibly be represented by a UChar. Use UShort instead. This was found by disasm-test like so: ./disasm-test --run vlrl *** mismatch VEX: |vlrl %v6,255,4| objdump: |vlrl %v6,4095,4| ./disasm-test --run vstrl *** mismatch VEX: |vstrl %v6,255(%r4),7| objdump: |vstrl %v6,4095(%r4),7| Fixes https://bugs.kde.org/show_bug.cgi?id=498422 --- NEWS | 1 + VEX/priv/guest_s390_toIR.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fd470fee7..304ce1c0b 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 498143 False positive on EVIOCGRAB ioctl 498317 FdBadUse is not a valid CoreError type in a suppression even though it's generated by --gen-suppressions=yes +498422 s390x: Fix VLRL and VSTRL insns 498492 none/tests/amd64/lzcnt64 crashes on FreeBSD compiled with clang 499183 FreeBSD: differences in avx-vmovq output 499212 mmap() with MAP_ALIGNED() returns unaligned pointer diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 6da599645..9fddd9549 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -4326,7 +4326,7 @@ s390_format_VRRa_VVVMMM(const HChar *(*irgen)(UChar v1, UChar v2, UChar v3, static void s390_format_VSI_URDV(const HChar *(*irgen)(UChar v1, IRTemp op2addr, UChar i3), - UChar v1, UChar b2, UChar d2, UChar i3, UChar rxb) + UChar v1, UChar b2, UShort d2, UChar i3, UChar rxb) { const HChar *mnm; IRTemp op2addr = newTemp(Ity_I64); -- 2.47.2