diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-20 13:02:05 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-20 15:08:06 -0400 |
commit | 5ecd1fec1583b8aa865ac5cae0cece42451395bd (patch) | |
tree | f9645884a611826dc811fe159c17fd873b98768b /src/common/util_bug.h | |
parent | 8865972a0b18a2fdcf42b55149989d0705c85577 (diff) | |
download | tor-5ecd1fec1583b8aa865ac5cae0cece42451395bd.tar.gz tor-5ecd1fec1583b8aa865ac5cae0cece42451395bd.zip |
Move horrible-emergency handling into torerr.[ch]
Previously we had code like this for bad things happening from
signal handlers, but it makes sense to use the same logic to handle
cases when something is happening at a level too low for log.c to be
involved.
My raw_assert*() stuff now uses this code.
Diffstat (limited to 'src/common/util_bug.h')
-rw-r--r-- | src/common/util_bug.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/common/util_bug.h b/src/common/util_bug.h index 0e1af2da14..1d499a197d 100644 --- a/src/common/util_bug.h +++ b/src/common/util_bug.h @@ -55,21 +55,6 @@ #error "Sorry; we don't support building with NDEBUG." #endif /* defined(NDEBUG) */ -/* The raw_assert...() variants are for use within code that can't call - * tor_assertion_failed_() because of call circularity issues. */ -#define raw_assert(expr) STMT_BEGIN \ - if (!(expr)) { \ - fprintf(stderr, "RAW ASSERTION FAILURE AT %s:%d: %s\n", \ - __FILE__, __LINE__, #expr); \ - abort(); \ - } \ - STMT_END -#define raw_assert_unreached(expr) raw_assert(0) -#define raw_assert_unreached_msg(msg) STMT_BEGIN \ - fprintf(stderr, "ERROR: %s\n", (msg)); \ - raw_assert_unreached(); \ - STMT_END - /* Sometimes we don't want to use assertions during branch coverage tests; it * leads to tons of unreached branches which in reality are only assertions we * didn't hit. */ |