From de7626985f29b06b29136286886c58185d0ff51f Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Fri, 22 Feb 2019 22:00:13 +0000 Subject: [PATCH] [Sanitizer] Fix uses of stack->Unwind(..., fast) Apply StackTrace::WillUseFastUnwind(fast) in a few more places missed by my previous patch (https://reviews.llvm.org/D58156). Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58550 llvm-svn: 354695 --- compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cc | 2 +- compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 3 ++- compiler-rt/lib/ubsan/ubsan_diag.cc | 2 +- .../test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cc b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cc index 111c3f6..ed1407b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cc @@ -103,7 +103,7 @@ void ReportMmapWriteExec(int prot) { GET_CALLER_PC_BP_SP; (void)sp; bool fast = common_flags()->fast_unwind_on_fatal; - if (fast) + if (StackTrace::WillUseFastUnwind(fast)) GetThreadStackTopAndBottom(false, &top, &bottom); stack->Unwind(kStackTraceMax, pc, bp, nullptr, top, bottom, fast); diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 6b03ad5..c0dab4d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -331,7 +331,8 @@ static void OnStackUnwind(const SignalContext &sig, const void *, uptr top = 0; uptr bottom = 0; bool fast = common_flags()->fast_unwind_on_fatal; - if (fast) GetThreadStackTopAndBottom(false, &top, &bottom); + if (StackTrace::WillUseFastUnwind(fast)) + GetThreadStackTopAndBottom(false, &top, &bottom); stack->Unwind(kStackTraceMax, sig.pc, sig.bp, sig.context, top, bottom, fast); } diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cc b/compiler-rt/lib/ubsan/ubsan_diag.cc index df75c2d..83b40e5 100644 --- a/compiler-rt/lib/ubsan/ubsan_diag.cc +++ b/compiler-rt/lib/ubsan/ubsan_diag.cc @@ -30,7 +30,7 @@ void __ubsan::GetStackTrace(BufferedStackTrace *stack, uptr max_depth, uptr pc, uptr bp, void *context, bool fast) { uptr top = 0; uptr bottom = 0; - if (fast) + if (StackTrace::WillUseFastUnwind(fast)) GetThreadStackTopAndBottom(false, &top, &bottom); stack->Unwind(max_depth, pc, bp, context, top, bottom, fast); } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc index 10a4748..f1fbbbc 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc @@ -10,8 +10,8 @@ // XFAIL: netbsd && !asan -// FIXME(dliew): Make this test work with other sanitizers -// XFAIL: darwin && (tsan || ubsan) +// FIXME(dliew): Make this test work with TSan +// XFAIL: darwin && tsan volatile int *null = 0; -- 2.7.4