luna: Introduce fail(...), a replacement for expect(false, ...)
This commit is contained in:
parent
5f6a659fa1
commit
dc795ff491
@ -19,6 +19,10 @@
|
||||
if (!(expr)) [[unlikely]] { __check_failed(location, message); } \
|
||||
} while (0)
|
||||
|
||||
// Fail with an error message and location.
|
||||
#define fail(message) __check_failed(SourceLocation::current(), message)
|
||||
#define fail_at(location, message) __check_failed(location, message)
|
||||
|
||||
// Like assert(), but always enabled.
|
||||
#define check(expr) \
|
||||
do { \
|
||||
|
@ -7,7 +7,7 @@ using namespace UBSAN::UBInfo;
|
||||
|
||||
[[noreturn]] void ub_panic(SourceLocation caller = SourceLocation::current())
|
||||
{
|
||||
expect_at(false, caller, "Undefined behavior");
|
||||
fail_at(caller, "Undefined behavior");
|
||||
}
|
||||
|
||||
#define DISPLAY(loc) loc.file, loc.line, loc.column
|
||||
|
Loading…
Reference in New Issue
Block a user