From: John Baldwin Date: Sat, 11 Jun 2016 14:26:09 +0000 (-0700) Subject: Initialize 'ra' to zero to avoid uninitialized use. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bec734b212d68d96560e309f49a584d98b98fbdc;p=binutils-gdb.git Initialize 'ra' to zero to avoid uninitialized use. If the instruction in this case does not include an RA field, then 'ra' is used uninitialized. Use the same idiom used elsewhere in this file of initializing ra to zero before check for an RA field. gdb/ChangeLog: * rs6000-tdep.c (ppc_process_record_op31): Initialize ra. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1bd309f3e2b..c0d4a3f2b7b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-06-14 John Baldwin + + * rs6000-tdep.c (ppc_process_record_op31): Initialize ra. + 2016-06-13 Nick Clifton * gdbtypes.c (replace_type): Fix assertion. diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 645fe9245c6..1ed1354f2d6 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -4631,6 +4631,7 @@ ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache, || at_dcsz == 0) at_dcsz = 128; /* Assume 128-byte cache line size (POWER8) */ + ra = 0; if (PPC_RA (insn) != 0) regcache_raw_read_unsigned (regcache, tdep->ppc_gp0_regnum + PPC_RA (insn), &ra);