From 9292b008db0b0002fdca06d33b0e7cc51b1e1503 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 17 May 2017 22:23:20 +0000 Subject: [PATCH] Attempt to pacify ASan and UBSan reports in CrashRecovery tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303311 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/CrashRecoveryTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unittests/Support/CrashRecoveryTest.cpp b/unittests/Support/CrashRecoveryTest.cpp index dbb0db57679..33d87a1c0e4 100644 --- a/unittests/Support/CrashRecoveryTest.cpp +++ b/unittests/Support/CrashRecoveryTest.cpp @@ -17,11 +17,15 @@ #include #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; } -- 2.50.1