diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-03-17 10:07:05 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-03-17 10:07:05 +0100 |
commit | 529b6c24ff2481b55123703cd25569ca8de717cc (patch) | |
tree | 3f26f2e1a1529d36b9973a580d502d87dab63880 /gas/expr.h | |
parent | 1250cd639016e5567ba8214acf8bf81e8a3ce2db (diff) | |
download | binutils-529b6c24ff2481b55123703cd25569ca8de717cc.zip binutils-529b6c24ff2481b55123703cd25569ca8de717cc.tar.gz binutils-529b6c24ff2481b55123703cd25569ca8de717cc.tar.bz2 |
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().
Diffstat (limited to 'gas/expr.h')
-rw-r--r-- | gas/expr.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |