aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJacob Navia <jacob@jacob.remcomp.fr>2023-09-18 12:03:58 +0100
committerNick Clifton <nickc@redhat.com>2023-09-18 12:03:58 +0100
commitcf2ab5ef0b716dea512d85276c484fce758fa5d4 (patch)
treed3cce4d5fb36cfda770372a3b00ef01985e858c9 /gas/config
parentcb2775070260eae210df62ab57df95927a89536e (diff)
downloadgdb-cf2ab5ef0b716dea512d85276c484fce758fa5d4.zip
gdb-cf2ab5ef0b716dea512d85276c484fce758fa5d4.tar.gz
gdb-cf2ab5ef0b716dea512d85276c484fce758fa5d4.tar.bz2
Fix: Use of uninitialized memory
* config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the allocated riscv_opcode structure.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-riscv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index cf6e0d8b..3b520ad 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -3718,7 +3718,7 @@ riscv_ip_hardcode (char *str,
if (*input_line_pointer != '\0')
return _("unrecognized values");
- insn = XNEW (struct riscv_opcode);
+ insn = XCNEW (struct riscv_opcode);
insn->match = values[num - 1];
create_insn (ip, insn);
unsigned int bytes = riscv_insn_length (insn->match);