From c8f7f84627cd51428059c3a73ef12d5f2d0122e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 25 Oct 2024 21:36:05 +0200 Subject: [PATCH] Add an assert in intr handler --- Core/HLE/sceKernelInterrupt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index f20d183048..598161a067 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -413,7 +413,11 @@ void __KernelReturnFromInterrupt() PendingInterrupt pend = pendingInterrupts.front(); pendingInterrupts.pop_front(); - intrHandlers[pend.intr]->handleResult(pend); + if (pend.intr >= 0 && pend.intr < ARRAY_SIZE(intrHandlers)) { + intrHandlers[pend.intr]->handleResult(pend); + } else { + _assert_msg_(false, "Bad pend.intr: %d", pend.intr); + } inInterrupt = false; // Restore context after running the interrupt.