summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/CrashRecoveryTest.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-05-17 22:23:20 +0000
committerReid Kleckner <rnk@google.com>2017-05-17 22:23:20 +0000
commitcde4b3f4e694b544521e40dada45025ed0196afa (patch)
tree8bf14595d09ed6c6e2ae7a5b1e43af8cd41d7db3 /llvm/unittests/Support/CrashRecoveryTest.cpp
parent3cd38a8d4ce8048b833f7058bfe2c11219f410e8 (diff)
downloadbcm5719-llvm-cde4b3f4e694b544521e40dada45025ed0196afa.tar.gz
bcm5719-llvm-cde4b3f4e694b544521e40dada45025ed0196afa.zip
Attempt to pacify ASan and UBSan reports in CrashRecovery tests
llvm-svn: 303311
Diffstat (limited to 'llvm/unittests/Support/CrashRecoveryTest.cpp')
-rw-r--r--llvm/unittests/Support/CrashRecoveryTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/unittests/Support/CrashRecoveryTest.cpp b/llvm/unittests/Support/CrashRecoveryTest.cpp
index dbb0db57679..33d87a1c0e4 100644
--- a/llvm/unittests/Support/CrashRecoveryTest.cpp
+++ b/llvm/unittests/Support/CrashRecoveryTest.cpp
@@ -17,11 +17,15 @@
#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; }
OpenPOWER on IntegriCloud