]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
arc gas: don't use X_md as input to expression()
authorAlan Modra <amodra@gmail.com>
Fri, 3 Oct 2025 23:06:22 +0000 (08:36 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 4 Oct 2025 00:09:02 +0000 (09:39 +0930)
commit4208f50c6d38057f6ad9ce6d017ea975a666e1e7
tree8fb4ecd0034972e9ebc5f0d1d2824452bb505ae9
parent32a7293a027d1bf7690d428075e52aa97dbf8350
arc gas: don't use X_md as input to expression()

tc-arc.c:tokenize_arguments tweaks expression() parsing, controlling
whether arc_parse_name does anything by setting X_op and X_md in the
expressionS argument passed to expression().  I want to change expr()
to always fully initialise its result, and that means either a special
expression initialiser for arc, or controlling arc_parse_name by some
other means.  Since arc_parse_name already tests "assembling_insn" and
no other code does, change "assembling_insn" to directly control
arc_parse_name.  Doing it this way also stops a possible uninitialised
access to right.X_op from expr() in arc_parse_name with current gas.
The next patch in this series will also stop such uninitialised
accesses.

* config/tc-arc.c (assembling_insn): Update comment.
(tokenize_arguments): Don't set X_op and X_md to control
expression(), instead just use assembling_insn.
(md_operand): Similarly.
(arc_parse_name): Don't test X_op and X_md.
(md_assemble): Don't set assembling_insn here.
gas/config/tc-arc.c