mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
x86: move register check in immediate operand parsing
i386_finalize_immediate() is used for both AT&T and Intel immediate operand handling. Move an AT&T-only check to i386_immediate(), which at the same time allows it to cover other cases as well, giving an overall better / more consistent diagnostic.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2021-05-07 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
|
* config/tc-i386.c (i386_finalize_immediate): Move register
|
||||||
|
check ...
|
||||||
|
(i386_immediate): ... here.
|
||||||
|
|
||||||
2021-05-07 Jan Beulich <jbeulich@suse.com>
|
2021-05-07 Jan Beulich <jbeulich@suse.com>
|
||||||
|
|
||||||
* config/tc-i386.c (optimize_imm): Drop redundant masking.
|
* config/tc-i386.c (optimize_imm): Drop redundant masking.
|
||||||
|
@ -10690,10 +10690,16 @@ i386_immediate (char *imm_start)
|
|||||||
{
|
{
|
||||||
free (gotfree_input_line);
|
free (gotfree_input_line);
|
||||||
|
|
||||||
if (exp->X_op == O_constant || exp->X_op == O_register)
|
if (exp->X_op == O_constant)
|
||||||
exp->X_op = O_illegal;
|
exp->X_op = O_illegal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exp_seg == reg_section)
|
||||||
|
{
|
||||||
|
as_bad (_("illegal immediate register operand %s"), imm_start);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return i386_finalize_immediate (exp_seg, exp, types, imm_start);
|
return i386_finalize_immediate (exp_seg, exp, types, imm_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10731,12 +10737,6 @@ i386_finalize_immediate (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!intel_syntax && exp_seg == reg_section)
|
|
||||||
{
|
|
||||||
if (imm_start)
|
|
||||||
as_bad (_("illegal immediate register operand %s"), imm_start);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This is an address. The size of the address will be
|
/* This is an address. The size of the address will be
|
||||||
|
Reference in New Issue
Block a user