diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp index bac9a112..303e7a9a 100644 --- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp @@ -288,14 +288,14 @@ namespace skyline::kernel::type { { std::scoped_lock lock{syncWaiterMutex}; + u32 userValue{__atomic_load_n(address, __ATOMIC_SEQ_CST)}; switch (type) { case ArbitrationType::WaitIfLessThan: - if (*address >= value) [[unlikely]] + if (userValue >= value) [[unlikely]] return result::InvalidState; break; case ArbitrationType::DecrementAndWaitIfLessThan: { - u32 userValue{__atomic_load_n(address, __ATOMIC_SEQ_CST)}; do { if (value <= userValue) [[unlikely]] // We want to explicitly decrement **after** the check return result::InvalidState; @@ -304,7 +304,7 @@ namespace skyline::kernel::type { } case ArbitrationType::WaitIfEqual: - if (*address != value) [[unlikely]] + if (userValue != value) [[unlikely]] return result::InvalidState; break; }