Print stack trace on assertion fail
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2022-12-16 20:49:09 +01:00
parent da39ba33a9
commit b316e3b3b7
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -118,10 +118,12 @@ static bool g_check_already_failed = false;
[[noreturn]] bool __check_failed(const char* file, const char* line, const char* func, const char* expr) [[noreturn]] bool __check_failed(const char* file, const char* line, const char* func, const char* expr)
{ {
CPU::disable_interrupts();
if (!g_check_already_failed) if (!g_check_already_failed)
{ // Avoid endlessly failing when trying to report a failed check. { // Avoid endlessly failing when trying to report a failed check.
g_check_already_failed = true; g_check_already_failed = true;
kerrorln("ERROR: Check failed at %s:%s, in %s: %s", file, line, func, expr); kerrorln("ERROR: Check failed at %s:%s, in %s: %s", file, line, func, expr);
CPU::print_stack_trace();
} }
CPU::efficient_halt(); CPU::efficient_halt();
} }