diff options
| -rw-r--r-- | src/core/hle/kernel/handle_table.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index 1bf79b692..c8acde5b1 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp | |||
| @@ -42,9 +42,10 @@ ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) { | |||
| 42 | u16 generation = next_generation++; | 42 | u16 generation = next_generation++; |
| 43 | 43 | ||
| 44 | // Overflow count so it fits in the 15 bits dedicated to the generation in the handle. | 44 | // Overflow count so it fits in the 15 bits dedicated to the generation in the handle. |
| 45 | // CTR-OS doesn't use generation 0, so skip straight to 1. | 45 | // Horizon OS uses zero to represent an invalid handle, so skip to 1. |
| 46 | if (next_generation >= (1 << 15)) | 46 | if (next_generation >= (1 << 15)) { |
| 47 | next_generation = 1; | 47 | next_generation = 1; |
| 48 | } | ||
| 48 | 49 | ||
| 49 | generations[slot] = generation; | 50 | generations[slot] = generation; |
| 50 | objects[slot] = std::move(obj); | 51 | objects[slot] = std::move(obj); |