RISC-V: Fix riscv_isa_string memory size bug
commitd1fd31f82219c306aed7c35c370852d2f8d331a8
authorMichael Clark <mjc@sifive.com>
Mon, 19 Mar 2018 21:18:49 +0000 (19 14:18 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 20 Mar 2018 11:45:55 +0000 (20 11:45 +0000)
treefe2b7b648a855157ccecfba52c6f8ba74d2bcbd1
parent4bdc24fa018901892bb8a5bd1808ebd605f4c64d
RISC-V: Fix riscv_isa_string memory size bug

This version uses a constant size memory buffer sized for
the maximum possible ISA string length. It also uses g_new
instead of g_new0, uses more efficient logic to append
extensions and adds manual zero termination of the string.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMM: Use qemu_tolower() rather than tolower()]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/riscv/cpu.c