Skip to content

Commit 1834660

Browse files
authored
[nfc][lsan] Replace suspended_threads.GetThreadID(i) with local var (#112607)
1 parent 1efa662 commit 1834660

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler-rt/lib/lsan/lsan_common.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ 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+
const tid_t os_id = static_cast<tid_t>(suspended_threads.GetThreadID(i));
409409
LOG_THREADS("Processing thread %llu.\n", os_id);
410410
uptr stack_begin, stack_end, tls_begin, tls_end, cache_begin, cache_end;
411411
DTLS *dtls;
@@ -429,9 +429,8 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
429429
continue;
430430
sp = stack_begin;
431431
}
432-
if (suspended_threads.GetThreadID(i) == caller_tid) {
432+
if (os_id == caller_tid)
433433
sp = caller_sp;
434-
}
435434

436435
if (flags()->use_registers && have_registers) {
437436
uptr registers_begin = reinterpret_cast<uptr>(registers.data());

0 commit comments

Comments
 (0)