:: commit ba662d02ea9e0d7920b328bab9aafa9b467cb527

Mintsuki <mintsuki@protonmail.com> — 2026-02-16 10:45

parents: 455aeb4967

sys/exceptions: Remove unnecessary exception number bounds check

diff --git a/common/sys/exceptions.s2.c b/common/sys/exceptions.s2.c
index cbe68f8e..8a4a7fcc 100644
--- a/common/sys/exceptions.s2.c
+++ b/common/sys/exceptions.s2.c
@@ -41,10 +41,7 @@ static const char *exception_names[] = {
 
 void except(uint32_t exception, uint32_t error_code, uint32_t ebp, uint32_t eip) {
     (void)ebp;
-    const char *exception_name = exception < SIZEOF_ARRAY(exception_names)
-                                 ? exception_names[exception]
-                                 : "Unknown";
-    panic(false, "%s exception at %x. Error code: %x", exception_name, eip, error_code);
+    panic(false, "%s exception at %x. Error code: %x", exception_names[exception], eip, error_code);
 }
 
 #endif
tab: 248 wrap: offon