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]

Patch SH Assembler: Generates error in case of instruction mov #Imm,rd


Hi,

In case of following instruction for SH,
	mov #H'0f,r10
SH ELF assembler crashes and gives segmentation fault. 
Instead SH ELF assembler should give error for wrong syntax.

Please find patch below which fixes this problem in SH assembler.
No new regressions found in DejaGnu testsuite after pacth.

ChangeLog:

2004-02-26  Anil Paranjpe  <anilp1@kpitcummins.com>
	 * config/tc-sh.c (get_operand) :  In case of #Imm, check has been added for wrong syntax.

--- binutils-040224/gas/config/tc-sh.c.old  Fri Dec  5 17:25:02 2003
+++ binutils-040224/gas/config/tc-sh.c	    Thu Feb 26 17:00:07 2004
@@ -1426,6 +1426,8 @@ get_operand (char **ptr, sh_operand_info
 
   if (src[0] == '#')
     {
+	  if( !isdigit(src[1]) )
+	     as_bad (_("syntax error in #Imm"));
       src++;
       *ptr = parse_exp (src, op);
       op->type = A_IMM;

Regards,
Anil


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