This way CRASH() can be used in functions that are themselves marked as noreturn.
@@ -53,3 +53,9 @@ void __assertion_failed(const char* msg)
}
#endif
+
+void __crash()
+{
+ asm volatile("ud2");
+ __builtin_unreachable();
+}
@@ -45,10 +45,9 @@ __attribute__((noreturn)) void __assertion_failed(const char* msg);
# define VERIFY_NOT_REACHED() CRASH()
-#define CRASH() \
- do { \
- asm volatile("ud2"); \
- } while (0)
+__attribute__((noreturn)) void __crash();
+#define CRASH() __crash()
#define VERIFY assert
#define TODO VERIFY_NOT_REACHED