HLE: Small kernel cleanups

Initialize the wokeThreads locals that were passed by reference uninitialized in
the event flag, VPL and semaphore timeout handlers. Harmless today since the
callee only ever assigns to them, but every other use in the same files starts
at false.

Do the semaphore overflow check in 64-bit, so a large signal value can't wrap
past it into currentCount.
This commit is contained in:
Henrik Rydgård committed 2026-09-04 18:10:10 -06:00
1 parent 00e2e89914
commit c4160b4eed
3 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -1435,7 +1435,7 @@ void __KernelVplTimeout(u64 userdata, int cyclesLate) {
// If in FIFO mode, that may have cleared another thread to wake up.
VPL *vpl = kernelObjects.Get<VPL>(uid, error);
if (vpl && (vpl->nv.attr & PSP_VPL_ATTR_MASK_ORDER) == PSP_VPL_ATTR_FIFO) {
bool wokeThreads;
bool wokeThreads = false;
std::vector<VplWaitingThread>::iterator iter = vpl->waitingThreads.begin();
// Unlock every waiting thread until the first that must still wait.
while (iter != vpl->waitingThreads.end() && __KernelUnlockVplForThread(vpl, *iter, error, 0, wokeThreads)) {