diff options
Diffstat (limited to 'src/lib/log/util_bug.h')
-rw-r--r-- | src/lib/log/util_bug.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/log/util_bug.h b/src/lib/log/util_bug.h index 63c5309c98..2e220b7286 100644 --- a/src/lib/log/util_bug.h +++ b/src/lib/log/util_bug.h @@ -106,7 +106,7 @@ } else { \ tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr, \ fmt, ##__VA_ARGS__); \ - abort(); \ + tor_abort_(); \ } STMT_END #endif /* defined(TOR_UNIT_TESTS) && defined(DISABLE_ASSERTS_IN_UNIT_TESTS) */ @@ -114,7 +114,7 @@ STMT_BEGIN { \ tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, \ "line should be unreached", NULL); \ - abort(); \ + tor_abort_(); \ } STMT_END /* Non-fatal bug assertions. The "unreached" variants mean "this line should @@ -149,7 +149,7 @@ #define BUG(cond) \ (ASSERT_PREDICT_UNLIKELY_(cond) ? \ (tor_assertion_failed_(SHORT_FILE__,__LINE__,__func__,"!("#cond")"), \ - abort(), 1) \ + tor_abort_(), 1) \ : 0) #elif defined(TOR_UNIT_TESTS) && defined(DISABLE_ASSERTS_IN_UNIT_TESTS) #define tor_assert_nonfatal_unreached() STMT_NIL @@ -246,6 +246,8 @@ void tor_bug_occurred_(const char *fname, unsigned int line, const char *func, const char *expr, int once, const char *fmt, ...); +void tor_abort_(void) ATTR_NORETURN; + #ifdef _WIN32 #define SHORT_FILE__ (tor_fix_source_file(__FILE__)) const char *tor_fix_source_file(const char *fname); |