diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-08-14 17:01:46 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-08-14 17:01:46 +0000 |
commit | f76bf5e00c9441f1f01364b7e69d81065327996e (patch) | |
tree | b2ce4abc37151bdedeafa65f08194b12fa1c2e34 | |
parent | 3756ef7e3505fde7c4919746c510b7dcbaabe3c5 (diff) | |
download | binutils-f76bf5e00c9441f1f01364b7e69d81065327996e.zip binutils-f76bf5e00c9441f1f01364b7e69d81065327996e.tar.gz binutils-f76bf5e00c9441f1f01364b7e69d81065327996e.tar.bz2 |
Terminate register name when reporting bad register
gas/
PR gas/14457
* config/tc-i386.c (i386_att_operand): Terminate register name
when reporting bad register.
gas/testsuite/
PR gas/14457
* gas/i386/i386.exp: Run reg-bad.
* gas/i386/reg-bad.l: New.
* gas/i386/reg-bad.s: Likewise.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 6 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/reg-bad.l | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/reg-bad.s | 5 |
6 files changed, 31 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 055d7d8..21d57db 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2012-08-14 H.J. Lu <hongjiu.lu@intel.com> + + PR gas/14457 + * config/tc-i386.c (i386_att_operand): Terminate register name + when reporting bad register. + 2012-08-14 Hans-Peter Nilsson <hp@bitrange.com> * config/tc-mmix.c (loc_asserts): New variable. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 171749e..61ca2c7 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -7782,6 +7782,9 @@ i386_att_operand (char *operand_string) } else if (*base_string == REGISTER_PREFIX) { + end_op = strchr (base_string, ','); + if (end_op) + *end_op = '\0'; as_bad (_("bad register name `%s'"), base_string); return 0; } @@ -7823,6 +7826,9 @@ i386_att_operand (char *operand_string) } else if (*base_string == REGISTER_PREFIX) { + end_op = strchr (base_string, ','); + if (end_op) + *end_op = '\0'; as_bad (_("bad register name `%s'"), base_string); return 0; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 237f9c3..3303cd7 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2012-08-14 H.J. Lu <hongjiu.lu@intel.com> + + PR gas/14457 + * gas/i386/i386.exp: Run reg-bad. + + * gas/i386/reg-bad.l: New. + * gas/i386/reg-bad.s: Likewise. + 2012-08-14 Hans-Peter Nilsson <hp@bitrange.com> * gas/mmix/err-fb-2.s: New test. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index b6a7115..4f3ee41 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -285,6 +285,7 @@ if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then { run_dump_test "intel-expr" run_dump_test "string-ok" run_list_test "string-bad" "" + run_list_test "reg-bad" "" run_list_test "space1" "-al" run_dump_test rept if [is_elf_format] then { diff --git a/gas/testsuite/gas/i386/reg-bad.l b/gas/testsuite/gas/i386/reg-bad.l new file mode 100644 index 0000000..654a7f1 --- /dev/null +++ b/gas/testsuite/gas/i386/reg-bad.l @@ -0,0 +1,5 @@ +.*: Assembler messages: +.*:2: Error: bad register name `%xxx' +.*:3: Error: bad register name `%xxx' +.*:4: Error: bad register name `%xxxxxxxxx' +.*:5: Error: bad register name `%xxxxxxxxx' diff --git a/gas/testsuite/gas/i386/reg-bad.s b/gas/testsuite/gas/i386/reg-bad.s new file mode 100644 index 0000000..e8454d6 --- /dev/null +++ b/gas/testsuite/gas/i386/reg-bad.s @@ -0,0 +1,5 @@ + .text + lea (%xxx,%esi,1),%esi + lea (%esi,%xxx,1),%esi + lea (%xxxxxxxxx,%esi,1),%esi + lea (%esi,%xxxxxxxxx,1),%esi |