diff --git a/Userland/Libraries/LibC/assert.cpp b/Userland/Libraries/LibC/assert.cpp index d4f99a1a87..2915d43962 100644 --- a/Userland/Libraries/LibC/assert.cpp +++ b/Userland/Libraries/LibC/assert.cpp @@ -53,3 +53,9 @@ void __assertion_failed(const char* msg) } #endif } + +void __crash() +{ + asm volatile("ud2"); + __builtin_unreachable(); +} diff --git a/Userland/Libraries/LibC/assert.h b/Userland/Libraries/LibC/assert.h index 572a35632a..3749e66c43 100644 --- a/Userland/Libraries/LibC/assert.h +++ b/Userland/Libraries/LibC/assert.h @@ -45,10 +45,9 @@ __attribute__((noreturn)) void __assertion_failed(const char* msg); # define VERIFY_NOT_REACHED() CRASH() #endif -#define CRASH() \ - do { \ - asm volatile("ud2"); \ - } while (0) +__attribute__((noreturn)) void __crash(); + +#define CRASH() __crash() #define VERIFY assert #define TODO VERIFY_NOT_REACHED