]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't include a backtrace test for dereferencing 0 under analyzers
authorNick Mathewson <nickm@torproject.org>
Tue, 2 Sep 2014 17:56:31 +0000 (13:56 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 2 Sep 2014 17:56:31 +0000 (13:56 -0400)
They hate this.

src/test/test_bt_cl.c

index 45ae82fb85a98cdcb1ee1b1716d3e43a5d90b20c..720ccd46274bf4a8d79bdad73e0353d9bd7e9b3d 100644 (file)
@@ -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) {