From bcf6da8cde1d09cb10cbd8798113f0cff2558962 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 11 Jun 2021 08:55:52 +0200 Subject: Kernel: Enable VERIFY() checks even if the DEBUG macro is not defined Fixes #7910. --- Kernel/Arch/i386/CPU.cpp | 2 -- Kernel/Assertions.h | 9 ++------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'Kernel') diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp index 36ced2fc0a..98026be2dc 100644 --- a/Kernel/Arch/i386/CPU.cpp +++ b/Kernel/Arch/i386/CPU.cpp @@ -2402,7 +2402,6 @@ void copy_ptrace_registers_into_kernel_registers(RegisterState& kernel_regs, con } } -#ifdef DEBUG void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) { asm volatile("cli"); @@ -2411,7 +2410,6 @@ void __assertion_failed(const char* msg, const char* file, unsigned line, const abort(); } -#endif [[noreturn]] void abort() { diff --git a/Kernel/Assertions.h b/Kernel/Assertions.h index 9ab58a9570..932e497301 100644 --- a/Kernel/Assertions.h +++ b/Kernel/Assertions.h @@ -9,14 +9,9 @@ #define __STRINGIFY_HELPER(x) #x #define __STRINGIFY(x) __STRINGIFY_HELPER(x) -#ifdef DEBUG [[noreturn]] void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func); -# define VERIFY(expr) (static_cast(expr) ? void(0) : __assertion_failed(# expr, __FILE__, __LINE__, __PRETTY_FUNCTION__)) -# define VERIFY_NOT_REACHED() VERIFY(false) -#else -# define VERIFY(expr) -# define VERIFY_NOT_REACHED() _abort() -#endif +#define VERIFY(expr) (static_cast(expr) ? void(0) : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__)) +#define VERIFY_NOT_REACHED() VERIFY(false) extern "C" { [[noreturn]] void _abort(); -- cgit v1.2.3