Skip to content

Commit 9b8f707

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
2 parents 37ad65f + 14730d9 commit 9b8f707

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler-rt/lib/lsan/lsan_common.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
405405
InternalMmapVector<uptr> registers;
406406
InternalMmapVector<Range> extra_ranges;
407407
for (uptr i = 0; i < suspended_threads.ThreadCount(); i++) {
408-
tid_t os_id = static_cast<tid_t>(suspended_threads.GetThreadID(i));
408+
registers.clear();
409+
extra_ranges.clear();
410+
const tid_t os_id = static_cast<tid_t>(suspended_threads.GetThreadID(i));
409411
LOG_THREADS("Processing thread %llu.\n", os_id);
410412
uptr stack_begin, stack_end, tls_begin, tls_end, cache_begin, cache_end;
411413
DTLS *dtls;
@@ -429,9 +431,8 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
429431
continue;
430432
sp = stack_begin;
431433
}
432-
if (suspended_threads.GetThreadID(i) == caller_tid) {
434+
if (os_id == caller_tid)
433435
sp = caller_sp;
434-
}
435436

436437
if (flags()->use_registers && have_registers) {
437438
uptr registers_begin = reinterpret_cast<uptr>(registers.data());
@@ -464,7 +465,6 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
464465
}
465466
ScanRangeForPointers(stack_begin, stack_end, frontier, "STACK",
466467
kReachable);
467-
extra_ranges.clear();
468468
GetThreadExtraStackRangesLocked(os_id, &extra_ranges);
469469
ScanExtraStackRanges(extra_ranges, frontier);
470470
}

0 commit comments

Comments
 (0)