From f2676efe23f03c1755715d049d53e26d1dac1864 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 20 Mar 2020 22:39:07 -0400 Subject: process: SetupMainThread: Zero out argument on process start. --- src/core/hle/kernel/process.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/hle/kernel') diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index edc414d69..ddbd75b8d 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -42,6 +42,8 @@ void SetupMainThread(Process& owner_process, KernelCore& kernel, u32 priority) { // Register 1 must be a handle to the main thread const Handle thread_handle = owner_process.GetHandleTable().Create(thread).Unwrap(); + thread->GetContext32().cpu_registers[0] = 0; + thread->GetContext64().cpu_registers[0] = 0; thread->GetContext32().cpu_registers[1] = thread_handle; thread->GetContext64().cpu_registers[1] = thread_handle; -- cgit v1.2.3