[PATCH] D19112: [asan] [SystemZ] Add slop for stack address detection.
    Marcin KoĆcielnicki via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Apr 18 02:07:04 PDT 2016
    
    
  
This revision was automatically updated to reflect the committed changes.
Closed by commit rL266593: [asan] [SystemZ] Add slop for stack address detection. (authored by koriakin).
Changed prior to commit:
  http://reviews.llvm.org/D19112?vs=53928&id=54041#toc
Repository:
  rL LLVM
http://reviews.llvm.org/D19112
Files:
  compiler-rt/trunk/lib/asan/asan_posix.cc
Index: compiler-rt/trunk/lib/asan/asan_posix.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_posix.cc
+++ compiler-rt/trunk/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.54041.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160418/ed021a3d/attachment.bin>
    
    
More information about the llvm-commits
mailing list