Skip to content

Commit

Permalink
Fix SystemCall Exit using the last exit code instead of 0
Browse files Browse the repository at this point in the history
Fixes #170
  • Loading branch information
TheThirdOne committed Feb 16, 2023
1 parent 06d1c60 commit 3897cfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rars/riscv/syscalls/SyscallExit.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rars.riscv.syscalls;

import rars.ExitingException;
import rars.Globals;
import rars.ProgramStatement;
import rars.riscv.AbstractSyscall;

Expand Down Expand Up @@ -41,6 +42,7 @@ public SyscallExit() {
}

public void simulate(ProgramStatement statement) throws ExitingException {
Globals.exitCode = 0;
throw new ExitingException(); // empty exception list.
}
}
}

0 comments on commit 3897cfa

Please sign in to comment.