summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-02-27 12:21:57 +0000
committerNick Clifton <nickc@redhat.com>2004-02-27 12:21:57 +0000
commitcceb2e20c769aecee1259d6f70313e2a2123b66a (patch)
tree332740a470408b09bd55413f6bd78803262683d2
parent06583a08a5419e5bb45dae13e244f0c0084f424b (diff)
downloadbinutils-redhat-cceb2e20c769aecee1259d6f70313e2a2123b66a.tar.gz
Fix seg fault on erroneous input
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-sh.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 60d17ae51d..1064635650 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-27 Anil Paranjpe <anilp1@kpitcummins.com>
+
+ * config/tc-sh.c (get_operand): In case of #Imm, check has been
+ added for wrong syntax.
+
2004-02-26 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c (mips_dwarf2_addr_size): New.
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 3e410e3038..b2c3694c81 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -1,6 +1,6 @@
/* tc-sh.c -- Assemble code for the Renesas / SuperH SH
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -1426,6 +1426,8 @@ get_operand (char **ptr, sh_operand_info *op)
if (src[0] == '#')
{
+ if (! ISDIGIT (src[1]))
+ as_bad (_("syntax error in #Imm"));
src++;
*ptr = parse_exp (src, op);
op->type = A_IMM;