diff options
author | Renato Golin <renato.golin@linaro.org> | 2016-04-22 14:56:30 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2016-04-22 14:56:30 +0000 |
commit | d61a344b362af7f0ab9461f04bb03915ef189818 (patch) | |
tree | 0892b4e8f5a581846f1edb415e4363612c0f2736 /lib | |
parent | 164bcc411202dce6c033567efeb62b1a2944dee0 (diff) |
Revert "[LSAN] Fix test swapcontext.cc on MIPS"
This reverts commit r266716, as it breaks the self-hosting on Thumb2 buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/asan/asan_stack.h | 5 | ||||
-rw-r--r-- | lib/lsan/lsan.h | 8 | ||||
-rw-r--r-- | lib/sanitizer_common/sanitizer_stacktrace.cc | 5 | ||||
-rw-r--r-- | lib/sanitizer_common/sanitizer_stacktrace.h | 5 |
4 files changed, 9 insertions, 14 deletions
diff --git a/lib/asan/asan_stack.h b/lib/asan/asan_stack.h index 74b7038fb..5c5181509 100644 --- a/lib/asan/asan_stack.h +++ b/lib/asan/asan_stack.h @@ -48,10 +48,7 @@ void GetStackTraceWithPcBpAndContext(BufferedStackTrace *stack, uptr max_depth, uptr stack_top = t->stack_top(); uptr stack_bottom = t->stack_bottom(); ScopedUnwinding unwind_scope(t); - if (IsValidFrame(bp, stack_top, stack_bottom)) { - stack->Unwind(max_depth, pc, bp, context, stack_top, stack_bottom, - fast); - } + stack->Unwind(max_depth, pc, bp, context, stack_top, stack_bottom, fast); } else if (!t && !fast) { /* If GetCurrentThread() has failed, try to do slow unwind anyways. */ stack->Unwind(max_depth, pc, bp, context, 0, 0, false); diff --git a/lib/lsan/lsan.h b/lib/lsan/lsan.h index f6f7a1b10..53783cdc9 100644 --- a/lib/lsan/lsan.h +++ b/lib/lsan/lsan.h @@ -20,14 +20,12 @@ { \ uptr stack_top = 0, stack_bottom = 0; \ ThreadContext *t; \ - if ((t = CurrentThreadContext())) { \ + if (fast && (t = CurrentThreadContext())) { \ stack_top = t->stack_end(); \ stack_bottom = t->stack_begin(); \ } \ - if (IsValidFrame(GET_CURRENT_FRAME(), stack_top, stack_bottom)) { \ - stack.Unwind(max_size, StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ - /* context */ 0, stack_top, stack_bottom, fast); \ - } \ + stack.Unwind(max_size, StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \ + /* context */ 0, stack_top, stack_bottom, fast); \ } #define GET_STACK_TRACE_FATAL \ diff --git a/lib/sanitizer_common/sanitizer_stacktrace.cc b/lib/sanitizer_common/sanitizer_stacktrace.cc index bf5456fc2..3c8142f3e 100644 --- a/lib/sanitizer_common/sanitizer_stacktrace.cc +++ b/lib/sanitizer_common/sanitizer_stacktrace.cc @@ -40,6 +40,11 @@ void BufferedStackTrace::Init(const uptr *pcs, uptr cnt, uptr extra_top_pc) { top_frame_bp = 0; } +// Check if given pointer points into allocated stack area. +static inline bool IsValidFrame(uptr frame, uptr stack_top, uptr stack_bottom) { + return frame > stack_bottom && frame < stack_top - 2 * sizeof (uhwptr); +} + // In GCC on ARM bp points to saved lr, not fp, so we should check the next // cell in stack to be a saved frame pointer. GetCanonicFrame returns the // pointer to saved frame pointer in any case. diff --git a/lib/sanitizer_common/sanitizer_stacktrace.h b/lib/sanitizer_common/sanitizer_stacktrace.h index 90142dffd..969cedb16 100644 --- a/lib/sanitizer_common/sanitizer_stacktrace.h +++ b/lib/sanitizer_common/sanitizer_stacktrace.h @@ -110,11 +110,6 @@ struct BufferedStackTrace : public StackTrace { void operator=(const BufferedStackTrace &); }; -// Check if given pointer points into allocated stack area. -static inline bool IsValidFrame(uptr frame, uptr stack_top, uptr stack_bottom) { - return frame > stack_bottom && frame < stack_top - 2 * sizeof (uhwptr); -} - } // namespace __sanitizer // Use this macro if you want to print stack trace with the caller |