This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Patch SH Assembler: Generates error in case of instruction mov #Imm,rd
- From: "Anil Paranjape" <AnilP1 at KPITCummins dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Fri, 27 Feb 2004 17:04:54 +0530
- Subject: 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