commit | 541cfb10f5daa17e48eb42365a74233cd551c545 | [log] [tgz] |
---|---|---|
author | Kostya Serebryany <kcc@google.com> | Fri Jan 18 11:30:36 2013 +0000 |
committer | Kostya Serebryany <kcc@google.com> | Fri Jan 18 11:30:36 2013 +0000 |
tree | 9a6bea3ad6f8194a355fd3660175ff09fc91decf | |
parent | 996c4f2fa53cce8f9d7b517073f38569460de505 [diff] [blame] |
[asan] fix two off-by-one errors that seem to affect only PowerPC because only there the stack top may be equal to the address space top. Noted by Andreas Schwab in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975#c11 . Also make swapcontext interceptor a bit more robust git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172807 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_thread.cc b/lib/asan/asan_thread.cc index a77e435..778e919 100644 --- a/lib/asan/asan_thread.cc +++ b/lib/asan/asan_thread.cc
@@ -74,7 +74,7 @@ void AsanThread::Init() { SetThreadStackTopAndBottom(); CHECK(AddrIsInMem(stack_bottom_)); - CHECK(AddrIsInMem(stack_top_)); + CHECK(AddrIsInMem(stack_top_ - 1)); ClearShadowForThreadStack(); if (flags()->verbosity >= 1) { int local = 0;