summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-11 08:55:52 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-11 11:32:01 +0200
commitbcf6da8cde1d09cb10cbd8798113f0cff2558962 (patch)
tree15efdbd9e2d3fce801ac353de11d730793be1157 /Kernel
parenteea95c4532913bf5719bd89ad2483c350e173477 (diff)
downloadserenity-bcf6da8cde1d09cb10cbd8798113f0cff2558962.zip
Kernel: Enable VERIFY() checks even if the DEBUG macro is not defined
Fixes #7910.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Arch/i386/CPU.cpp2
-rw-r--r--Kernel/Assertions.h9
2 files changed, 2 insertions, 9 deletions
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<bool>(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<bool>(expr) ? void(0) : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
+#define VERIFY_NOT_REACHED() VERIFY(false)
extern "C" {
[[noreturn]] void _abort();