Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / teshsuite / mc / random-bug / random-bug.cpp
index 9bade15..80b910e 100644 (file)
@@ -3,6 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <csignal>
 #include <cstring>
 #include <simgrid/modelchecker.h>
 #include <simgrid/s4u.hpp>
@@ -30,11 +31,8 @@ static void app()
     if (x == 3 && y == 4)
       abort();
   } else if (behavior == Behavior::SEGV) {
-#ifndef __clang_analyzer__
-    int* A = nullptr;
     if (x == 3 && y == 4)
-      *A = 1;
-#endif
+      raise(SIGSEGV); // Simulate a segfault without displeasing the static analyzers
   } else {
     DIE_IMPOSSIBLE;
   }