mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
gas: apply md_register_arithmetic also to unary '+'
Even a unary '+' has to be considered arithmetic; at least on x86 in Intel Syntax mode otherwise bogus insn operands may be accepted. Convert this specific case to binary + (i.e. 0 + <register>). (An implication is that md_operator(,1,) would need to deal with arch- specific equivalents of unary '+' is a similar way, if such an arch- specific variant would be specified in the first place.) To avoid duplicating what make_expr_symbol() does to construct a constant-zero expression, simply make its previously local variable a file-scope static one. This way there's also no need to invoke clean_up_expression().
This commit is contained in:
@@ -182,7 +182,7 @@ extern void add_to_result (expressionS *, offsetT, int);
|
||||
extern void subtract_from_result (expressionS *, offsetT, int);
|
||||
extern segT expr (int, expressionS *, enum expr_mode);
|
||||
extern unsigned int get_single_number (void);
|
||||
extern symbolS *make_expr_symbol (expressionS * expressionP);
|
||||
extern symbolS *make_expr_symbol (const expressionS * expressionP);
|
||||
extern int expr_symbol_where (symbolS *, const char **, unsigned int *);
|
||||
extern void current_location (expressionS *);
|
||||
extern symbolS *expr_build_uconstant (offsetT);
|
||||
|
||||
Reference in New Issue
Block a user