Fixed the stack_sz used for stack_top in threadCreate(). t->stack_sz is uninitialized at the time stack_top is set, hence this was causing memory corruption in some cases.

This commit is contained in:
yellows8 2017-11-25 12:54:42 -05:00
parent cca73c47fa
commit 9703ddbf3e

View File

@ -53,7 +53,7 @@ Result threadCreate(
if (R_SUCCEEDED(rc))
{
u64 stack_top = ((u64)stack_mirror) + t->stack_sz - sizeof(ThreadEntryArgs);
u64 stack_top = ((u64)stack_mirror) + stack_sz - sizeof(ThreadEntryArgs);
ThreadEntryArgs* args = (ThreadEntryArgs*) stack_top;
Handle handle;