From 3897cfa9953e82ee1b309707d72c37b3f0c20c6f Mon Sep 17 00:00:00 2001 From: Benjamin Landers Date: Thu, 16 Feb 2023 12:33:47 -0800 Subject: [PATCH] Fix SystemCall Exit using the last exit code instead of 0 Fixes #170 --- src/rars/riscv/syscalls/SyscallExit.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rars/riscv/syscalls/SyscallExit.java b/src/rars/riscv/syscalls/SyscallExit.java index 8927b550..0b8f7a12 100644 --- a/src/rars/riscv/syscalls/SyscallExit.java +++ b/src/rars/riscv/syscalls/SyscallExit.java @@ -1,6 +1,7 @@ package rars.riscv.syscalls; import rars.ExitingException; +import rars.Globals; import rars.ProgramStatement; import rars.riscv.AbstractSyscall; @@ -41,6 +42,7 @@ public SyscallExit() { } public void simulate(ProgramStatement statement) throws ExitingException { + Globals.exitCode = 0; throw new ExitingException(); // empty exception list. } -} \ No newline at end of file +}