From: Julian Seward Date: Sat, 14 Jul 2012 14:21:56 +0000 (+0000) Subject: Get rid of gcc warnings about uninitialised variables in the arm front end. X-Git-Tag: svn/VALGRIND_3_8_1^2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c47cee6fcf8e49e6fdbad5383b7185baf10df690;p=thirdparty%2Fvalgrind.git Get rid of gcc warnings about uninitialised variables in the arm front end. git-svn-id: svn://svn.valgrind.org/vex/trunk@2432 --- diff --git a/VEX/priv/guest_arm_toIR.c b/VEX/priv/guest_arm_toIR.c index af1202cda6..86346c646a 100644 --- a/VEX/priv/guest_arm_toIR.c +++ b/VEX/priv/guest_arm_toIR.c @@ -14417,7 +14417,8 @@ DisResult disInstr_THUMB_WRK ( # define INSN0(_bMax,_bMin) SLICE_UInt(((UInt)insn0), (_bMax), (_bMin)) DisResult dres; - UShort insn0; /* first 16 bits of the insn */ + UShort insn0; /* first 16 bits of the insn */ + UShort insn1; /* second 16 bits of the insn */ //Bool allow_VFP = False; //UInt hwcaps = archinfo->hwcaps; HChar dis_buf[128]; // big enough to hold LDMIA etc text @@ -14448,6 +14449,10 @@ DisResult disInstr_THUMB_WRK ( unlikely, but ..) if the second 16 bits aren't actually necessary. */ insn0 = getUShortLittleEndianly( guest_instr ); + insn1 = 0; /* We'll get it later, once we know we need it. */ + + /* Similarly, will set this later. */ + IRTemp old_itstate = IRTemp_INVALID; if (0) vex_printf("insn: 0x%x\n", insn0); @@ -14627,10 +14632,11 @@ DisResult disInstr_THUMB_WRK ( that through the full preamble (which completely disappears). */ IRTemp condT = IRTemp_INVALID; - IRTemp old_itstate = IRTemp_INVALID; - IRTemp new_itstate = IRTemp_INVALID; IRTemp cond_AND_notInIT_T = IRTemp_INVALID; + IRTemp new_itstate = IRTemp_INVALID; + vassert(old_itstate == IRTemp_INVALID); + if (guaranteedUnconditional) { /* BEGIN "partial eval { ITSTATE = 0; STANDARD_PREAMBLE; }" */ @@ -16118,7 +16124,8 @@ DisResult disInstr_THUMB_WRK ( # define INSN1(_bMax,_bMin) SLICE_UInt(((UInt)insn1), (_bMax), (_bMin)) /* second 16 bits of the instruction, if any */ - UShort insn1 = getUShortLittleEndianly( guest_instr+2 ); + vassert(insn1 == 0); + insn1 = getUShortLittleEndianly( guest_instr+2 ); anOp = Iop_INVALID; /* paranoia */ anOpNm = NULL; /* paranoia */ @@ -18401,7 +18408,9 @@ DisResult disInstr_THUMB_WRK ( /* Back up ITSTATE to the initial value for this instruction. If we don't do that, any subsequent restart of the instruction will restart with the wrong value. */ - put_ITSTATE(old_itstate); + if (old_itstate != IRTemp_INVALID) + put_ITSTATE(old_itstate); + /* Tell the dispatcher that this insn cannot be decoded, and so has not been executed, and (is currently) the next to be executed. R15 should be up-to-date since it made so at the start of each