]> granicus.if.org Git - llvm/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303311 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/CrashRecoveryTest.cpp

index dbb0db57679376008be1929fbbf9dfe2d0e8a11f..33d87a1c0e4a9c6953a17f18718da377eef44c9e 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; }