From: Simon Cook Date: Wed, 27 May 2020 16:34:58 +0000 (+0100) Subject: RISC-V: Fix missing initialization of riscv_csr_extra structs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c5055683b980c71e96b642565418ffdefc6f171;p=binutils-gdb.git RISC-V: Fix missing initialization of riscv_csr_extra structs The next pointer of struct riscv_csr_extra was not always initilized to NULL or a valid pointer, causing the assembler to attempt to read through an uninitialized pointer on startup. gas/ChangeLog: * config/tc-riscv.c (riscv_init_csr_hash): NULL initilize next pointer when creating struct riscv_csr_extra. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 97d87762507..0d1565f00d3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-05-27 Simon Cook + + * config/tc-riscv.c (riscv_init_csr_hash): NULL initilize next + pointer when creating struct riscv_csr_extra. + 2020-05-26 H.J. Lu * testsuite/gas/i386/align-branch-9.d: Updated for PECOFF. diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 2a03a440b19..da94b5b1cfb 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -695,6 +695,7 @@ riscv_init_csr_hash (const char *name, entry->address = address; entry->define_version = define_version; entry->abort_version = abort_version; + entry->next = NULL; /* If the CSR hasn't been inserted in the hash table, then insert it. Otherwise, attach the extra information to the entry which is already