summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
index 20b8760935b..0c27c472f02 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
@@ -170,6 +170,10 @@ PtraceRegistersStatus SuspendedThreadsListMac::GetRegistersAndSP(
internal_memcpy(buffer, &regs, sizeof(regs));
*sp = regs.SP_REG;
+ // On x86_64 and aarch64, we must account for the stack redzone, which is 128
+ // bytes.
+ if (SANITIZER_WORDSIZE == 64) *sp -= 128;
+
return REGISTERS_AVAILABLE;
}
OpenPOWER on IntegriCloud