Add another sanity check for swapcontext, which is currently unsupported. Patch by Alexey Samsonov!

llvm-svn: 233413
This commit is contained in:
Nick Lewycky 2015-03-27 20:40:23 +00:00
parent bceb2a5a1c
commit 816e0eabb7
1 changed files with 1 additions and 1 deletions

View File

@ -290,7 +290,7 @@ static void ClearShadowMemoryForContextStack(uptr stack, uptr ssize) {
ssize += stack - bottom;
ssize = RoundUpTo(ssize, PageSize);
static const uptr kMaxSaneContextStackSize = 1 << 22; // 4 Mb
if (ssize && ssize <= kMaxSaneContextStackSize) {
if (AddrIsInMem(bottom) && ssize && ssize <= kMaxSaneContextStackSize) {
PoisonShadow(bottom, ssize, 0);
}
}