From 5c12bbf28455ba893a750b9b01a904829dbed1e7 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 5 Nov 2024 17:56:41 +0100 Subject: [PATCH] quick and dirty fix of segmentation fault error due to excCause array buffer overflow. Old exception string code in excCause array no longer match with new exception numbers in uriscv. --- src/uriscv/processor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/uriscv/processor.cc b/src/uriscv/processor.cc index 4e7393a..dc6decf 100644 --- a/src/uriscv/processor.cc +++ b/src/uriscv/processor.cc @@ -454,7 +454,9 @@ void Processor::getPrevStatus(Word *pc, Word *instr) { // exception happened (thanks to excName[] array) const char *Processor::getExcCauseStr() { // 0 means no exception - if (excCause) + if (CAUSE_IS_INT(excCause)) + return "INT"; + else if (excCause) return excName[excCause]; else return (EMPTYSTR);