diff options
author | Nick Mathewson <nickm@torproject.org> | 2021-01-19 12:45:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2021-01-19 12:45:07 -0500 |
commit | a22bfe04bcb106b14e2416e39dc9f43dc82eeba0 (patch) | |
tree | 632a0aa411f829d9cd41363779c84158091ab755 /src/lib | |
parent | 17eb6355320c414d83cbc3c1930ec54ae7cd1ea4 (diff) | |
parent | 2d5b21598ea04b3beb59cb678d8b438b27c45ee1 (diff) | |
download | tor-a22bfe04bcb106b14e2416e39dc9f43dc82eeba0.tar.gz tor-a22bfe04bcb106b14e2416e39dc9f43dc82eeba0.zip |
Merge branch 'maint-0.3.5' into maint-0.4.3
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/log/util_bug.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/log/util_bug.h b/src/lib/log/util_bug.h index ae3d125a08..d9dbc7ee09 100644 --- a/src/lib/log/util_bug.h +++ b/src/lib/log/util_bug.h @@ -240,6 +240,17 @@ IF_BUG_ONCE__(ASSERT_PREDICT_UNLIKELY_(cond), \ IF_BUG_ONCE_VARNAME__(__LINE__)) +/** + * Use this macro after a nonfatal assertion, and before a case statement + * where you would want to fall through. + */ +#ifdef ALL_BUGS_ARE_FATAL +#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL \ + abort() +#else +#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL FALLTHROUGH +#endif + /** Define this if you want Tor to crash when any problem comes up, * so you can get a coredump and track things down. */ // #define tor_fragile_assert() tor_assert_unreached(0) |