summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2021-05-29 00:31:04 -0400
committerGravatar Lioncash2021-05-29 00:31:38 -0400
commit16ff0161b349624803c3a823a6518f4718f60ee6 (patch)
tree4130301a801025f6ae8e9bcb4eff6639fb28e77d /src
parentMerge pull request #6375 from lioncash/iofs (diff)
downloadyuzu-16ff0161b349624803c3a823a6518f4718f60ee6.tar.gz
yuzu-16ff0161b349624803c3a823a6518f4718f60ee6.tar.xz
yuzu-16ff0161b349624803c3a823a6518f4718f60ee6.zip
k_thread: Move dereference after null check in Initialize()
Prevents a -Wnonnull warning on GCC.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_thread.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index e3f08f256..3cf43d290 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -168,13 +168,13 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s
168 std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0, 168 std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0,
169 sizeof(StackParameters)); 169 sizeof(StackParameters));
170 170
171 // Setup the TLS, if needed.
172 if (type == ThreadType::User) {
173 tls_address = owner->CreateTLSRegion();
174 }
175
176 // Set parent, if relevant. 171 // Set parent, if relevant.
177 if (owner != nullptr) { 172 if (owner != nullptr) {
173 // Setup the TLS, if needed.
174 if (type == ThreadType::User) {
175 tls_address = owner->CreateTLSRegion();
176 }
177
178 parent = owner; 178 parent = owner;
179 parent->Open(); 179 parent->Open();
180 parent->IncrementThreadCount(); 180 parent->IncrementThreadCount();