aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-26 12:58:22 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-26 12:58:22 -0400
commit18734d3b25f3a26fea3fd78e64136da9bcd3836d (patch)
treee7dc6e3b9efade1387bb18faf3303373b9c6ee35 /src
parent3c017e823bdcfeea4316755b208fa2bf9df5fb00 (diff)
parent0117e2ea0dc09408e2fbc7224e335968af009874 (diff)
downloadtor-18734d3b25f3a26fea3fd78e64136da9bcd3836d.tar.gz
tor-18734d3b25f3a26fea3fd78e64136da9bcd3836d.zip
Merge branch 'maint-0.2.9' into maint-0.3.0
Diffstat (limited to 'src')
-rw-r--r--src/common/util_bug.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/util_bug.h b/src/common/util_bug.h
index e02778110b..0695806911 100644
--- a/src/common/util_bug.h
+++ b/src/common/util_bug.h
@@ -58,6 +58,19 @@
* return -1;
*/
+#ifdef __COVERITY__
+#undef BUG
+// Coverity defines this in global headers; let's override it. This is a
+// magic coverity-only preprocessor thing.
+#nodef BUG(x) ((x)?(__coverity_panic__(),1):0)
+#endif
+
+#if defined(__COVERITY__) || defined(__clang_analyzer__)
+// We're running with a static analysis tool: let's treat even nonfatal
+// assertion failures as something that we need to avoid.
+#define ALL_BUGS_ARE_FATAL
+#endif
+
#ifdef ALL_BUGS_ARE_FATAL
#define tor_assert_nonfatal_unreached() tor_assert(0)
#define tor_assert_nonfatal(cond) tor_assert((cond))