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,12 @@ if (UNLIKELY(!asan_inited)) return; AsanThread *t = GetCurrentThread(); - if (t && !t->isUnwinding() && WillUseFastUnwind(request_fast)) { + if (!t || t->isUnwinding()) 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;