diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-10-12 10:57:28 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-10-12 10:57:31 -0400 |
| commit | b4690a33c0c3720f1601dcc7e95cacbbed9ed0bd (patch) | |
| tree | 16bdfd11f80396ae0f92dec0d5fde6c6a902ba17 /src/core/hle/kernel/thread.cpp | |
| parent | 69b235739534c96af4ae067ac20805f26e3c5194 (diff) | |
thread: Remove unnecessary memset from ResetThreadContext()
Regular value initialization is adequate here for zeroing out data. It
also has the benefit of not invoking undefined behavior if a non-trivial
type is ever added to the struct for whatever reason.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 33aed8c237..352ce17255 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -183,13 +183,10 @@ void Thread::ResumeFromWait() { */ static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top, VAddr entry_point, u64 arg) { - memset(&context, 0, sizeof(Core::ARM_Interface::ThreadContext)); - + context = {}; context.cpu_registers[0] = arg; context.pc = entry_point; context.sp = stack_top; - context.pstate = 0; - context.fpcr = 0; } ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point, |
