]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390_irgen_EX_SS: add initialisations so as to remove (false positive) warnings from...
authorJulian Seward <jseward@acm.org>
Tue, 7 Nov 2017 14:01:51 +0000 (15:01 +0100)
committerJulian Seward <jseward@acm.org>
Tue, 7 Nov 2017 14:01:51 +0000 (15:01 +0100)
When compiling guest_s390_toIR.c for a 32-bit target (a configuration in which
it will never be used, but never mind), gcc-7.x notices that sizeof(ss.dec) is
larger than sizeof(ss.bytes), so the initialisation of ss.bytes leaves ss.dec.b2
and ss.dec.d2 uninitialised.  This patch causes both variants to be initialised.
When built for a 64 bit target, the existing initialisation of ss.bytes covers
ss.dec completely, so there is no error.

VEX/priv/guest_s390_toIR.c

index 14c8950826abd21f26b112aecc929f4d286291ef..b36b85e91880820821314d90740867be8ffb76f8 100644 (file)
@@ -11078,6 +11078,7 @@ s390_irgen_EX_SS(UChar r, IRTemp addr2,
    stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_CMLEN), mkU64(4)));
    restart_if(mkexpr(cond));
 
+   ss.dec.op = ss.dec.l = ss.dec.b1 = ss.dec.d1 = ss.dec.b2 = ss.dec.d2 = 0;
    ss.bytes = last_execute_target;
    assign(start1, binop(Iop_Add64, mkU64(ss.dec.d1),
           ss.dec.b1 != 0 ? get_gpr_dw0(ss.dec.b1) : mkU64(0)));