Attempt to pacify ASan and UBSan reports in CrashRecovery tests
authorReid Kleckner <rnk@google.com>
Wed, 17 May 2017 22:23:20 +0000 (22:23 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 17 May 2017 22:23:20 +0000 (22:23 +0000)
llvm-svn: 303311

llvm/unittests/Support/CrashRecoveryTest.cpp

index dbb0db5..33d87a1 100644 (file)
 #include <windows.h>
 #endif
 
+extern "C" const char *__asan_default_options() {
+  return "allow_user_segv_handler=1";
+}
+
 using namespace llvm;
 using namespace llvm::sys;
 
 static int GlobalInt = 0;
-static void nullDeref() { *(volatile int *)nullptr = 0; }
+static void nullDeref() { *(volatile int *)0x10 = 0; }
 static void incrementGlobal() { ++GlobalInt; }
 static void llvmTrap() { LLVM_BUILTIN_TRAP; }