]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Fix 64-bit shift in s390_irgen_VSTRS
authorAndreas Arnez <arnez@li-32acfd01-53a8-11cb-b225-9c4f961b6dbf.ibm.com>
Fri, 17 Sep 2021 16:48:12 +0000 (18:48 +0200)
committerAndreas Arnez <arnez@li-32acfd01-53a8-11cb-b225-9c4f961b6dbf.ibm.com>
Fri, 17 Sep 2021 16:48:12 +0000 (18:48 +0200)
The function s390_irgen_VSTRS in guest_s390_toIR.c contains a shift
operation that is intended to yield a 64-bit number but uses 1UL instead
of 1ULL.  This doesn't work on systems where 'unsigned long' is only 32
bits wide.  Fix by replacing 1UL by 1ULL.

VEX/priv/guest_s390_toIR.c

index 1bd18f7602a72538d3e6879a24856e6d5f7895eb..72222ab045559525da68078dce50c0421af4906b 100644 (file)
@@ -17679,7 +17679,7 @@ s390_irgen_VSTRS(UChar v1, UChar v2, UChar v3, UChar v4, UChar m5, UChar m6)
    assign(result, unop(Iop_ClzNat64,
                        binop(Iop_Or64,
                              unop(Iop_V128HIto64, match),
-                             mkU64((1UL << 48) - 1))));
+                             mkU64((1ULL << 48) - 1))));
    put_vr_qw(v1, binop(Iop_64HLtoV128, mkexpr(result), mkU64(0)));
 
    /* Set condition code.