forked from OSchip/llvm-project
[asan] [SystemZ] Add slop for stack address detection.
On s390, siginfo reports the faulting address with page granularity - we need to mask off the low bits of sp before comparison. Differential Revision: http://reviews.llvm.org/D19112 llvm-svn: 266593
This commit is contained in:
parent
cf6bbd3909
commit
48f32510da
|
@ -43,7 +43,15 @@ void AsanOnDeadlySignal(int signo, void *siginfo, void *context) {
|
|||
// 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.
|
||||
|
|
Loading…
Reference in New Issue