summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_linux.cc4
-rw-r--r--compiler-rt/test/asan/TestCases/Linux/segv_read_write.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
index 80009ea4e91..782e520e69b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
@@ -1156,8 +1156,12 @@ void internal_join_thread(void *th) {}
#endif
bool GetSigContextWriteFlag(void *context) {
+#if defined(__x86_64__) || defined(__i386__)
ucontext_t *ucontext = (ucontext_t*)context;
return ucontext->uc_mcontext.gregs[REG_ERR] & 2;
+#else
+ return false; // FIXME: Implement.
+#endif
}
void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
diff --git a/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c b/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
index 84103713737..db6726cd374 100644
--- a/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
+++ b/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
@@ -1,6 +1,7 @@
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ
// RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE
+// REQUIRES: x86_64-supported-target
static volatile int sink;
__attribute__((noinline)) void Read(int *ptr) { sink = *ptr; }
OpenPOWER on IntegriCloud