[NFC] Move asan_inited and size reset on top of  ::UnwindImpl
@@ -31,13 +31,14 @@ u32 GetMallocContextSize() {
void __sanitizer::BufferedStackTrace::UnwindImpl(
uptr pc, uptr bp, void *context, bool request_fast, u32 max_depth) {
using namespace __asan;
+ size = 0;
+ if (UNLIKELY(!asan_inited))
+ return;
#if SANITIZER_WINDOWS
Unwind(max_depth, pc, 0, context, 0, 0, false);
#else
- AsanThread *t;
- size = 0;
- if (LIKELY(asan_inited)) {
- if ((t = GetCurrentThread()) && !t->isUnwinding()) {
+ AsanThread *t = GetCurrentThread();
+ if (t && !t->isUnwinding()) {
uptr stack_top = t->stack_top();
uptr stack_bottom = t->stack_bottom();
ScopedUnwinding unwind_scope(t);
@@ -51,7 +52,6 @@ void __sanitizer::BufferedStackTrace::UnwindImpl(
/* If GetCurrentThread() has failed, try to do slow unwind anyways. */
Unwind(max_depth, pc, bp, context, 0, 0, false);
}
- }
#endif // SANITIZER_WINDOWS
}
