]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
mips gas: expression initialisation
authorAlan Modra <amodra@gmail.com>
Fri, 3 Oct 2025 23:09:02 +0000 (08:39 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 4 Oct 2025 00:09:02 +0000 (09:39 +0930)
commit3fc9616817eb5467dcd23bf4b00a95b752c20554
tree910d023e7822b108f65fc2e9a3bf2af4233d94b1
parente3f9c2f90efe233208a75ccf317faad4716bec69
mips gas: expression initialisation

There is a make_expr_symbol in append_insn, which gets called from
macro_build, which is all over the place.  Many of these set up an
expression without initialising all fields.  Now the uninitialised
fields should not be accessed in a properly functioning assembler,
but I'm inclined to think anything copied ought to be initialised.

* config/tc-mips.c (fix_loongson2f_jump, load_register),
(add_got_offset, add_got_offset_hilo, macro_build_branch_likely),
(macro, mips16_macro, s_cpload, s_cpsetup, s_cprestore)
(s_cpreturn): Use structure initialiser to ensure all fields of
expression are initialised.
(load_address): Copy entire structure for the same reason.
gas/config/tc-mips.c