ladybird/AK/Assertions.cpp
Andreas Kling da781e90c1 AK: Print VERIFY() error messages in release builds
Until now, VERIFY() failures would just cause a __builtin_trap() in
release builds, which made them a bit too harsh. This commit adds an
out-of-line helper function that prints the error before trapping.
2022-10-06 15:29:38 +02:00

21 lines
354 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Assertions.h>
#include <AK/Format.h>
#if !defined(KERNEL) && defined(NDEBUG)
extern "C" {
void ak_verification_failed(char const* message)
{
dbgln("VERIFICATION FAILED: {}", message);
__builtin_trap();
}
}
#endif