mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix crash in sceKernelExitDeleteThread().
0 means current thread, seen in Wild Arms XF. Doesn't make the game run but at least it doesn't segfault.
This commit is contained in:
parent
59d623a0f2
commit
808c7e9807
1 changed files with 18 additions and 4 deletions
|
@ -889,10 +889,24 @@ u32 sceKernelStartThread()
|
|||
|
||||
void sceKernelGetThreadStackFreeSize()
|
||||
{
|
||||
SceUID threadID = PARAM(0);
|
||||
INFO_LOG(HLE,"sceKernelGetThreadStackFreeSize(%i)", threadID);
|
||||
u32 error;
|
||||
Thread *thread = kernelObjects.Get<Thread>(threadID, error);
|
||||
SceUID threadID = PARAM(0);
|
||||
Thread *thread;
|
||||
|
||||
INFO_LOG(HLE,"sceKernelGetThreadStackFreeSize(%i)", threadID);
|
||||
|
||||
if (threadID == 0)
|
||||
thread = currentThread;
|
||||
else
|
||||
{
|
||||
u32 error;
|
||||
thread = kernelObjects.Get<Thread>(threadID, error);
|
||||
if (thread == 0)
|
||||
{
|
||||
ERROR_LOG(HLE,"sceKernelGetThreadStackFreeSize: invalid thread id %i", threadID);
|
||||
RETURN(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Scan the stack for 0xFF
|
||||
int sz = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue