From 34bf413661ad8e7d460961e258776a5b8865eea4 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Fri, 29 Oct 2021 18:31:50 +0100 Subject: [PATCH] Fix bitmask check for event IDs > 32 in Ctrl::SyncpointFreeEventBatch Doing 1 << 32 would result in an integer overflow rather than the desired behaviour of checking a bit, make 1 64 bit to present that. --- app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp index 25ad1076..41e02dc3 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp @@ -225,7 +225,7 @@ namespace skyline::service::nvdrv::device::nvhost { std::lock_guard lock(syncpointEventMutex); for (u32 i{}; i < std::numeric_limits::digits; i++) - if (bitmask & (1 << i)) + if (bitmask & (1ULL << i)) if (auto freeErr{SyncpointFreeEventLocked(i)}; freeErr != PosixResult::Success) err = freeErr;