This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use of uninitialised data in tc-sh.c


I think this solves it.  At least, it looks right, passes valgrind,
and passes make check.  Note that, for each case where this code
accidentally failed before, it ends up doing the right thing anyway.
(that's not an excuse, just noting this is a low priority patch)

2005-01-18  DJ Delorie  <dj@redhat.com>

	* config/tc-sh.c (get_specific): Only check limits when the
	operand matches the expected argument.

Index: config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.103
diff -p -U3 -r1.103 tc-sh.c
--- config/tc-sh.c	17 Jan 2005 14:08:10 -0000	1.103
+++ config/tc-sh.c	18 Jan 2005 20:15:54 -0000
@@ -1562,7 +1562,9 @@ get_specific (sh_opcode_info *opcode, sh
 
 	  if (SH_MERGE_ARCH_SET_VALID (valid_arch, arch_sh2a_nofpu_up)
 	      && (   arg == A_DISP_REG_M
-		  || arg == A_DISP_REG_N))
+		  || arg == A_DISP_REG_N)
+	      && (   user->type == A_DISP_REG_M
+		  || user->type == A_DISP_REG_N))
 	    {
 	      /* Check a few key IMM* fields for overflow.  */
 	      int opf;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]