utils: BUG_ON was not doing what the comment says

It should abort if the expr is true, but is doing the other way around

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-18 19:20:58 +00:00
parent 974698764b
commit 3bac1d8845
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 3 additions and 3 deletions

View File

@ -49,9 +49,9 @@ safe_isnan(double a) {
#define BUG_ON(expr) \
do { \
bool __bug_on_tmp = (expr); \
assert(__bug_on_tmp && "original expr: " #expr); \
if (!__bug_on_tmp) { \
fprintf(stderr, "BUG_ON: check \"%s\" failed \n", #expr); \
assert(!__bug_on_tmp && "Original expr: " #expr); \
if (__bug_on_tmp) { \
fprintf(stderr, "BUG_ON: \"%s\"\n", #expr); \
abort(); \
} \
} while (0)