[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Don't include a backtrace test for dereferencing 0 under analyzers
commit 32b88d2565daa47c087fb5610405fcb57c3ed153
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Tue Sep 2 13:56:31 2014 -0400
Don't include a backtrace test for dereferencing 0 under analyzers
They hate this.
---
src/test/test_bt_cl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c
index 45ae82f..720ccd4 100644
--- a/src/test/test_bt_cl.c
+++ b/src/test/test_bt_cl.c
@@ -30,7 +30,12 @@ int
crash(int x)
{
if (crashtype == 0) {
+#if defined(__clang_analyzer__) || defined(__COVERITY__)
+ tor_assert(1 == 0); /* Avert your eyes, clangalyzer and coverity! You
+ * don't need to see us dereference NULL. */
+#else
*(volatile int *)0 = 0;
+#endif
} else if (crashtype == 1) {
tor_assert(1 == 0);
} else if (crashtype == -1) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits