diff --git a/compiler-rt/lib/asan/asan_stack.cc b/compiler-rt/lib/asan/asan_stack.cc --- a/compiler-rt/lib/asan/asan_stack.cc +++ b/compiler-rt/lib/asan/asan_stack.cc @@ -35,10 +35,17 @@ if (UNLIKELY(!asan_inited)) return; AsanThread *t = GetCurrentThread(); - if (t && !t->isUnwinding() && WillUseFastUnwind(request_fast)) { + if (!t || t->isUnwinding()) { +#if SANITIZER_CAN_SLOW_UNWIND + UnwindSlowWithOptionalContext(pc, context, max_depth); +#endif + return; + } + + ScopedUnwinding unwind_scope(t); + if (WillUseFastUnwind(request_fast)) { uptr top = t->stack_top(); uptr bottom = t->stack_bottom(); - ScopedUnwinding unwind_scope(t); if (!SANITIZER_MIPS || IsValidFrame(bp, top, bottom)) { UnwindFast(pc, bp, top, bottom, max_depth); return; @@ -46,7 +53,7 @@ } #if SANITIZER_CAN_SLOW_UNWIND - UnwindSlowWithOptionalContext(pc, context, max_depth); + UnwindSlowWithOptionalContext(pc, context, max_depth); #endif }