This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch SH Assembler: Generates error in case of instruction mov#Imm,rd
- From: Nick Clifton <nickc at redhat dot com>
- To: "Anil Paranjape" <AnilP1 at KPITCummins dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: Fri, 27 Feb 2004 12:22:01 +0000
- Subject: Re: Patch SH Assembler: Generates error in case of instruction mov#Imm,rd
- References: <69595093233BB547BB70CF5E492B63F2043F7CBA@sohm.kpit.com>
Hi Anil,
> 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;
Thank you very much for submitting this patch. I have applied it with
one small change. I replaced 'isdigit' with 'ISDIGIT' since tc-sh.c
uses the safe-ctype.h header file.
Cheers
Nick