forked from OSchip/llvm-project
[NFC] Reorder ifs in BufferedStackTrace::UnwindImpl
llvm-svn: 355376
This commit is contained in:
parent
81dbc02671
commit
4d9d2251ab
|
@ -38,20 +38,24 @@ void __sanitizer::BufferedStackTrace::UnwindImpl(
|
||||||
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
||||||
#else
|
#else
|
||||||
AsanThread *t = GetCurrentThread();
|
AsanThread *t = GetCurrentThread();
|
||||||
if (t && !t->isUnwinding()) {
|
if (!t) {
|
||||||
uptr stack_top = t->stack_top();
|
if (!request_fast) {
|
||||||
uptr stack_bottom = t->stack_bottom();
|
/* If GetCurrentThread() has failed, try to do slow unwind anyways. */
|
||||||
ScopedUnwinding unwind_scope(t);
|
|
||||||
if (SANITIZER_MIPS && !IsValidFrame(bp, stack_top, stack_bottom))
|
|
||||||
return;
|
|
||||||
if (StackTrace::WillUseFastUnwind(request_fast))
|
|
||||||
Unwind(max_depth, pc, bp, nullptr, stack_top, stack_bottom, true);
|
|
||||||
else
|
|
||||||
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
||||||
} else if (!t && !request_fast) {
|
}
|
||||||
/* If GetCurrentThread() has failed, try to do slow unwind anyways. */
|
return;
|
||||||
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
|
||||||
}
|
}
|
||||||
|
if (t->isUnwinding())
|
||||||
|
return;
|
||||||
|
uptr stack_top = t->stack_top();
|
||||||
|
uptr stack_bottom = t->stack_bottom();
|
||||||
|
ScopedUnwinding unwind_scope(t);
|
||||||
|
if (SANITIZER_MIPS && !IsValidFrame(bp, stack_top, stack_bottom))
|
||||||
|
return;
|
||||||
|
if (StackTrace::WillUseFastUnwind(request_fast))
|
||||||
|
Unwind(max_depth, pc, bp, nullptr, stack_top, stack_bottom, true);
|
||||||
|
else
|
||||||
|
Unwind(max_depth, pc, bp, context, 0, 0, false);
|
||||||
#endif // SANITIZER_WINDOWS
|
#endif // SANITIZER_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue