mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
Return true after queueing a guest syscall override
dispatchSyscallOverride returns bool, and its caller uses that to decide whether the built-in handler still needs to run. The success path -- the one that actually queues the guest's handler as an invocation -- fell off the end of the function without returning. That is undefined behaviour, and the practical failure mode is bad: whatever happened to be in the return register decided whether the built-in syscall ran in addition to the guest's override, so a game that overrides a syscall could get the effect applied twice, or not at all, depending on the build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -440,6 +440,11 @@ namespace ps2_syscalls
|
||||
parent.r[2] = completed.r[2];
|
||||
};
|
||||
scheduler.invokeCurrent(std::move(invocation));
|
||||
// The invocation is queued and the caller must not fall through to the
|
||||
// built-in handler. Falling off the end of a non-void function here was
|
||||
// undefined behaviour: whatever happened to be in the return register
|
||||
// decided whether the built-in ran as well as the guest's override.
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool tryResolveGuestSyscallMirrorAddr(uint32_t syscallIndex, uint32_t &guestAddr)
|
||||
|
||||
Reference in New Issue
Block a user