PR25249, Memory leak in microblaze-dis.c
authorAlan Modra <amodra@gmail.com>
Thu, 5 Dec 2019 04:12:44 +0000 (14:42 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 5 Dec 2019 04:28:15 +0000 (14:58 +1030)
commit378fd436405b3051df34ac995b2e03fe1f3d1907
treeb0afdf8a20ce1c11686cb0abe281e4193c10265a
parentc72a8174b3b45aab8fdda2b0b5232f00fb8287c4
PR25249, Memory leak in microblaze-dis.c

PR 25249
* microblaze-dis.c (NUM_STRBUFS, STRBUF_SIZE): Define.
(struct string_buf): New.
(strbuf): New function.
(get_field): Use strbuf rather than strdup of local temp.
(get_field_imm, get_field_imm5, get_field_imm5_mbar): Likewise.
(get_field_rfsl, get_field_imm15): Likewise.
(get_field_rd, get_field_r1, get_field_r2): Update macros.
(get_field_special): Likewise.  Don't strcpy spr.  Formatting.
(print_insn_microblaze): Formatting.  Init and pass string_buf to
get_field functions.
opcodes/ChangeLog
opcodes/microblaze-dis.c