]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: apply md_register_arithmetic also to unary '+'
authorJan Beulich <jbeulich@suse.com>
Fri, 17 Mar 2023 09:07:05 +0000 (10:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 17 Mar 2023 09:07:05 +0000 (10:07 +0100)
commit529b6c24ff2481b55123703cd25569ca8de717cc
tree3f26f2e1a1529d36b9973a580d502d87dab63880
parent1250cd639016e5567ba8214acf8bf81e8a3ce2db
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().
gas/expr.c
gas/expr.h