diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index 80009ea4e914..782e520e69b5 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 841037137378..db6726cd3741 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; }