Fix using the uninitialized disassemble object. (#220)
authorSeungRyeol Lee <zizztux@gmail.com>
Mon, 23 Jul 2018 20:14:05 +0000 (05:14 +0900)
committerAndrew Waterman <aswaterman@gmail.com>
Mon, 23 Jul 2018 20:14:05 +0000 (13:14 -0700)
This fixes runtime crash when custom extension registers its
disassembly.

riscv/processor.cc

index 9fc5d5f63a6558c1e8258a7f705fa638d7be9d0c..52f69c1d460778519bf34f8020c4c6b73b9dd3cb 100644 (file)
@@ -24,11 +24,11 @@ processor_t::processor_t(const char* isa, simif_t* sim, uint32_t id,
   : debug(false), halt_request(false), sim(sim), ext(NULL), id(id),
   halt_on_reset(halt_on_reset), last_pc(1), executions(1)
 {
+  disassembler = new disassembler_t(max_xlen);
   parse_isa_string(isa);
   register_base_instructions();
 
   mmu = new mmu_t(sim, this);
-  disassembler = new disassembler_t(max_xlen);
 
   reset();
 }