瀏覽代碼

process: SetupMainThread: Zero out argument on process start.

bunnei 6 年之前
父節點
當前提交
f2676efe23
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/core/hle/kernel/process.cpp

+ 2 - 0
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;