diff options
author | Liam <byteslice@airmail.cc> | 2023-03-08 01:46:48 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-08 01:46:48 +0100 |
commit | d45ac00d48352d86a483e7642bfccadf1eb4f4ce (patch) | |
tree | 9c8327fa45f820e586835f8547fb4b976bbca500 /src/core/hle/kernel/k_resource_limit.cpp | |
parent | Merge pull request #9889 from Morph1984/time-is-ticking (diff) | |
download | yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar.gz yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar.bz2 yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar.lz yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar.xz yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.tar.zst yuzu-d45ac00d48352d86a483e7642bfccadf1eb4f4ce.zip |
Diffstat (limited to 'src/core/hle/kernel/k_resource_limit.cpp')
-rw-r--r-- | src/core/hle/kernel/k_resource_limit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp index b9d22b414..626517619 100644 --- a/src/core/hle/kernel/k_resource_limit.cpp +++ b/src/core/hle/kernel/k_resource_limit.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" +#include "common/overflow.h" #include "core/core.h" #include "core/core_timing.h" #include "core/hle/kernel/k_resource_limit.h" @@ -104,7 +105,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { ASSERT(current_hints[index] <= current_values[index]); // If we would overflow, don't allow to succeed. - if (current_values[index] + value <= current_values[index]) { + if (Common::WrappingAdd(current_values[index], value) <= current_values[index]) { break; } |