Skip to content

Commit

Permalink
quick and dirty fix of segmentation fault error due to excCause
Browse files Browse the repository at this point in the history
array buffer overflow. Old exception string code in excCause array
no longer match with new exception numbers in uriscv.
  • Loading branch information
llllluca committed Nov 5, 2024
1 parent 92e0c5d commit 5c12bbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/uriscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5c12bbf

Please sign in to comment.