aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-utils.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-10-04 08:37:02 +0930
committerAlan Modra <amodra@gmail.com>2025-10-04 09:39:02 +0930
commitaa8956639252a6af92e41fdc57401471b919b96a (patch)
treee4d35dac1d9f3745467578693b333a47747f7e68 /gdb/python/py-utils.c
parent4208f50c6d38057f6ad9ce6d017ea975a666e1e7 (diff)
downloadbinutils-aa8956639252a6af92e41fdc57401471b919b96a.zip
binutils-aa8956639252a6af92e41fdc57401471b919b96a.tar.gz
binutils-aa8956639252a6af92e41fdc57401471b919b96a.tar.bz2
gas: initialisation of expressionS in operand()
This patch removes clean_up_expression which runs just before operand() returns. clean_up_expression sets as yet uninitialised fields of expressionS. Well, it sets fields based on the value of X_op, trusting that others have been written, and has one notable exception: X_md is not initialised. Instead initialise expressionS fully inside operand(), which is called at the start of expr(), and introduce md_expr_init for the odd backends that want to mess with X_md. This is in response to an oss-fuzz report that read.c:pseudo_set calls expr() leaving exp.X_md uninitialised and can copy that to a symbol via symbol_set_value_expression. tc-i386-intel.c:565 is one place that later tests the uninitialised X_md. * config/tc-z80.h (md_expr_init, md_expr_init_rest): Define. * config/tc-microblaze.h: Likewise. * expr.c (clean_up_expression): Delete. (operand): Init expression early. (expr): Use md_expr_init_rest to init X_md when necessary.
Diffstat (limited to 'gdb/python/py-utils.c')
0 files changed, 0 insertions, 0 deletions