mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-02 20:42:29 +01:00
sceKernelCreateLwMutex: Reject a misaligned work area
A 6.60 PSP returns SCE_KERNEL_ERROR_ILLEGAL_ADDR for one (checked with a throwaway test; the other bad addresses hang the PSP, so they can't go in pspautotests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a778a13ff
commit
b238eb2125
1 file changed
+5
@@ -609,6 +609,11 @@ int sceKernelCreateLwMutex(MIPSState *mips, u32 workareaPtr, const char *name, u
|
||||
return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_COUNT);
|
||||
}
|
||||
|
||||
// A PSP rejects a misaligned work area. One it can't access hangs it instead, so for those the
|
||||
// error is our choice.
|
||||
if ((workareaPtr & 3) != 0) {
|
||||
return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "misaligned workarea");
|
||||
}
|
||||
auto workarea = PSPPointer<NativeLwMutexWorkarea>::Create(workareaPtr);
|
||||
if (!workarea.IsValid()) {
|
||||
return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "bad workarea");
|
||||
|
||||
Reference in new issue
Block a user