Skip to content

Commit a0a48ce

Browse files
committed
rebase
Created using spr 1.3.4
2 parents 86eb360 + cd2a0b3 commit a0a48ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_thread_history.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ void PrintThreadHistory(ThreadRegistry &registry, InternalScopedString &out) {
5454
return parent;
5555
};
5656

57-
u32 stack_id = 0;
57+
const ThreadContextBase *prev = nullptr;
5858
for (const ThreadContextBase *context : stacks) {
59-
if (stack_id != context->stack_id) {
60-
StackDepotGet(stack_id).PrintTo(&out);
61-
stack_id = context->stack_id;
59+
if (prev->stack_id != context->stack_id) {
60+
StackDepotGet(prev->stack_id).PrintTo(&out);
61+
prev = context;
6262
}
6363
out.Append("Thread ");
6464
describe_thread(context);
6565
out.Append(" was created by ");
6666
describe_thread(get_parent(context));
6767
out.Append("\n");
6868
}
69-
if (!stacks.empty())
70-
StackDepotGet(stack_id).PrintTo(&out);
69+
if (prev)
70+
StackDepotGet(prev->stack_id).PrintTo(&out);
7171
}
7272

7373
} // namespace __sanitizer

0 commit comments

Comments
 (0)