diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-06-07 12:02:15 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-06-07 12:02:15 +0200 |
commit | c8d541e2e73493228f332f4bdc9ecc8164d3744f (patch) | |
tree | 2b051a512008ef805e71d3837a7124fdc73aecb8 /gas | |
parent | 98ff9f1c5d0bff7545d508288a5699522277d570 (diff) | |
download | binutils-gdb-c8d541e2e73493228f332f4bdc9ecc8164d3744f.tar.gz |
x86: correct absolute branch check with segment override
This needs to happen before checking of what may legitimately start a
memory operand (like is done when there's no segment override). Plus a
second '*' shouldn't be permitted when one was already found before the
segment override.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 66e040aaa14..008027b1fc1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2021-06-07 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (i386_att_operand): Flip checking for '*' and + start-of-expression. Don't permit '*' when one was already seen. + +2021-06-07 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (parse_operands): Don't check for matched square brackets. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index a20aea28718..0fe439eddd5 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -11413,22 +11413,22 @@ i386_att_operand (char *operand_string) if (is_space_char (*op_string)) ++op_string; - if (!is_digit_char (*op_string) - && !is_identifier_char (*op_string) - && *op_string != '(' - && *op_string != ABSOLUTE_PREFIX) - { - as_bad (_("bad memory operand `%s'"), op_string); - return 0; - } /* Handle case of %es:*foo. */ - if (*op_string == ABSOLUTE_PREFIX) + if (!i.jumpabsolute && *op_string == ABSOLUTE_PREFIX) { ++op_string; if (is_space_char (*op_string)) ++op_string; i.jumpabsolute = true; } + + if (!is_digit_char (*op_string) + && !is_identifier_char (*op_string) + && *op_string != '(') + { + as_bad (_("bad memory operand `%s'"), op_string); + return 0; + } goto do_memory_reference; } |