summaryrefslogtreecommitdiff
path: root/lib/asan/asan_linux.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-01-17 15:45:28 +0000
committerAlexey Samsonov <samsonov@google.com>2013-01-17 15:45:28 +0000
commit57db4bae483e7268dd7fc5bc42b0e55564014048 (patch)
treea900e9cd285efa817f237037b9d0f839362b3ffc /lib/asan/asan_linux.cc
parent0fc2f6935568db9252272bd9c00895255d7f78b9 (diff)
[ASan] minor changes to swapcontext handling: don't clear shadow memory if context stack is too large
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r--lib/asan/asan_linux.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
index 3f9370e30..1606ab258 100644
--- a/lib/asan/asan_linux.cc
+++ b/lib/asan/asan_linux.cc
@@ -120,20 +120,14 @@ void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp, bool fast) {
}
#if !ASAN_ANDROID
-void ClearShadowMemoryForContext(void *context) {
+void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
ucontext_t *ucp = (ucontext_t*)context;
- uptr sp = (uptr)ucp->uc_stack.ss_sp;
- uptr size = ucp->uc_stack.ss_size;
- // Align to page size.
- uptr PageSize = GetPageSizeCached();
- uptr bottom = sp & ~(PageSize - 1);
- size += sp - bottom;
- size = RoundUpTo(size, PageSize);
- PoisonShadow(bottom, size, 0);
+ *stack = (uptr)ucp->uc_stack.ss_sp;
+ *ssize = ucp->uc_stack.ss_size;
}
#else
-void ClearShadowMemoryForContext(void *context) {
- UNIMPLEMENTED();
+void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
+ return UNIMPLEMENTED();
}
#endif