From: Jan Beulich Date: Wed, 23 Mar 2022 11:29:39 +0000 (+0100) Subject: Revert "PR28977 tc-i386.c internal error in parse_register" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b55a1d00ad3cf9fe3db7e9347e6f3bbe4d04b9b;p=binutils-gdb.git Revert "PR28977 tc-i386.c internal error in parse_register" This reverts commit 5fac3f02edacfca458f7eeaaaa33a87e26e0e332, which was superceeded / replaced by 4faaa10f3fab. --- diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index aea19aa5d88..ec82144ed1b 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -12978,18 +12978,17 @@ parse_register (char *reg_string, char **end_op) { const expressionS *e = symbol_get_value_expression (symbolP); - if (e->X_op == O_register - && (valueT) e->X_add_number < i386_regtab_size) + know (e->X_op == O_register); + know (e->X_add_number >= 0 + && (valueT) e->X_add_number < i386_regtab_size); + r = i386_regtab + e->X_add_number; + if (!check_register (r)) { - r = i386_regtab + e->X_add_number; - if (!check_register (r)) - { - as_bad (_("register '%s%s' cannot be used here"), - register_prefix, r->reg_name); - r = &bad_reg; - } - *end_op = input_line_pointer; + as_bad (_("register '%s%s' cannot be used here"), + register_prefix, r->reg_name); + r = &bad_reg; } + *end_op = input_line_pointer; } *input_line_pointer = c; input_line_pointer = save;