diff --git a/riscv/mmu.cc b/riscv/mmu.cc index b7d49d4c..1e8dd8bd 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -104,7 +104,7 @@ reg_t reg_from_bytes(size_t len, const uint8_t* bytes) bool mmu_t::mmio_ok(reg_t addr, access_type type) { // Disallow access to debug region when not in debug mode - if (addr >= DEBUG_START && addr <= DEBUG_END && !proc->state.debug_mode) + if (addr >= DEBUG_START && addr <= DEBUG_END && proc && !proc->state.debug_mode) return false; return true;