Skip to content

Commit

Permalink
[nfc][lsan] Replace suspended_threads.GetThreadID(i) with local var (
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka authored Oct 16, 2024
1 parent 1efa662 commit 1834660
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler-rt/lib/lsan/lsan_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
InternalMmapVector<uptr> registers;
InternalMmapVector<Range> extra_ranges;
for (uptr i = 0; i < suspended_threads.ThreadCount(); i++) {
tid_t os_id = static_cast<tid_t>(suspended_threads.GetThreadID(i));
const tid_t os_id = static_cast<tid_t>(suspended_threads.GetThreadID(i));
LOG_THREADS("Processing thread %llu.\n", os_id);
uptr stack_begin, stack_end, tls_begin, tls_end, cache_begin, cache_end;
DTLS *dtls;
Expand All @@ -429,9 +429,8 @@ static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
continue;
sp = stack_begin;
}
if (suspended_threads.GetThreadID(i) == caller_tid) {
if (os_id == caller_tid)
sp = caller_sp;
}

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

0 comments on commit 1834660

Please sign in to comment.