From 9d1be08473a9e6b6005750bd19b45d3243668ae4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 27 Jan 2022 00:02:18 -0800 Subject: [PATCH] Kernel: Fail threads with invalid priority. No real reports so far except what looks like garbage data, which probably crashes anyway. --- Core/HLE/sceKernelThread.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index e3acac064b..b2fb0ee811 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1958,10 +1958,7 @@ int __KernelCreateThread(const char *threadName, SceUID moduleID, u32 entry, u32 if ((u32)stacksize < 0x200) return hleReportWarning(SCEKERNEL, SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE, "bogus thread stack size %08x", stacksize); if (prio < 0x08 || prio > 0x77) { - WARN_LOG_REPORT(SCEKERNEL, "sceKernelCreateThread(name=%s): bogus priority %08x", threadName, prio); - // TODO: Should return this error. - // return SCE_KERNEL_ERROR_ILLEGAL_PRIORITY; - prio = prio < 0x08 ? 0x08 : 0x77; + return hleReportWarning(SCEKERNEL, SCE_KERNEL_ERROR_ILLEGAL_PRIORITY, "bogus thread priority %08x", prio); } if (!Memory::IsValidAddress(entry)) { // The PSP firmware seems to allow NULL...?