This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Use of uninitialised data in tc-sh.c
- From: DJ Delorie <dj at redhat dot com>
- To: andrew dot stubbs at st dot com
- Cc: aoliva at redhat dot com, binutils at sources dot redhat dot com
- Date: Tue, 18 Jan 2005 15:23:09 -0500
- Subject: Re: Use of uninitialised data in tc-sh.c
- References: <005e01c4f8b9$4f409fd0$0d0f81a4@uk.w2k.superh.com>
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;