diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-03-25 20:53:55 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-04-17 01:48:16 -0700 |
commit | 5d02bead010e65ca391fc534039da0d39652a9e5 (patch) | |
tree | a17e6d20cc16b6482fa4362309143943877229b5 /riscv/disasm.h | |
parent | 8962ec40c7c13eca0dfc1f23beec263743bfbcbb (diff) | |
download | spike-5d02bead010e65ca391fc534039da0d39652a9e5.zip spike-5d02bead010e65ca391fc534039da0d39652a9e5.tar.gz spike-5d02bead010e65ca391fc534039da0d39652a9e5.tar.bz2 |
disasm: make instruction name dynamic
to support not const instruction name generated by generated string
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/disasm.h')
-rw-r--r-- | riscv/disasm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/riscv/disasm.h b/riscv/disasm.h index 3c50794..d322731 100644 --- a/riscv/disasm.h +++ b/riscv/disasm.h @@ -32,7 +32,8 @@ class disasm_insn_t public: disasm_insn_t(const char* name, uint32_t match, uint32_t mask, const std::vector<const arg_t*>& args) - : match(match), mask(mask), args(args), name(name) {} + : match(match), mask(mask), args(args), name(strdup(name)) {} + ~disasm_insn_t() { free(const_cast<char *>(name)); } bool operator == (insn_t insn) const { |