summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-01-19 12:45:07 -0500
committerNick Mathewson <nickm@torproject.org>2021-01-19 12:45:07 -0500
commita22bfe04bcb106b14e2416e39dc9f43dc82eeba0 (patch)
tree632a0aa411f829d9cd41363779c84158091ab755 /src/lib
parent17eb6355320c414d83cbc3c1930ec54ae7cd1ea4 (diff)
parent2d5b21598ea04b3beb59cb678d8b438b27c45ee1 (diff)
downloadtor-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.h11
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)