[PATCH] D19112: [asan] [SystemZ] Add slop for stack address detection.
Marcin KoĆcielnicki via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 15 12:07:15 PDT 2016
koriakin updated this revision to Diff 53928.
Repository:
rL LLVM
http://reviews.llvm.org/D19112
Files:
lib/asan/asan_posix.cc
Index: lib/asan/asan_posix.cc
===================================================================
--- lib/asan/asan_posix.cc
+++ lib/asan/asan_posix.cc
@@ -43,7 +43,15 @@
// Access at a reasonable offset above SP, or slightly below it (to account
// for x86_64 or PowerPC redzone, ARM push of multiple registers, etc) is
// probably a stack overflow.
+#ifdef __s390__
+ // On s390, the fault address in siginfo points to start of the page, not
+ // to the precise word that was accessed. Mask off the low bits of sp to
+ // take it into account.
+ bool IsStackAccess = sig.addr >= (sig.sp & ~0xFFF) &&
+ sig.addr < sig.sp + 0xFFFF;
+#else
bool IsStackAccess = sig.addr + 512 > sig.sp && sig.addr < sig.sp + 0xFFFF;
+#endif
#if __powerpc__
// Large stack frames can be allocated with e.g.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19112.53928.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160415/68ad69f9/attachment.bin>
More information about the llvm-commits
mailing list