[PATCH] D33072: Account for stack redzone when computing sp on darwin

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 08:01:46 PDT 2017


fjricci updated this revision to Diff 98631.
fjricci added a comment.

Remove accidental inclusion of extra files


https://reviews.llvm.org/D33072

Files:
  lib/sanitizer_common/sanitizer_stoptheworld_mac.cc


Index: lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
===================================================================
--- lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
+++ lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
@@ -170,6 +170,10 @@
   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;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33072.98631.patch
Type: text/x-patch
Size: 507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170511/1c7aea4a/attachment.bin>


More information about the llvm-commits mailing list