[llvm] r303311 - Attempt to pacify ASan and UBSan reports in CrashRecovery tests

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 15:23:20 PDT 2017


Author: rnk
Date: Wed May 17 17:23:20 2017
New Revision: 303311

URL: http://llvm.org/viewvc/llvm-project?rev=303311&view=rev
Log:
Attempt to pacify ASan and UBSan reports in CrashRecovery tests

Modified:
    llvm/trunk/unittests/Support/CrashRecoveryTest.cpp

Modified: llvm/trunk/unittests/Support/CrashRecoveryTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CrashRecoveryTest.cpp?rev=303311&r1=303310&r2=303311&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/CrashRecoveryTest.cpp (original)
+++ llvm/trunk/unittests/Support/CrashRecoveryTest.cpp Wed May 17 17:23:20 2017
@@ -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; }
 




More information about the llvm-commits mailing list