Skip to content

Commit

Permalink
[NFC][sanitizer] Simplify GetThreadLocked
Browse files Browse the repository at this point in the history
Now we can pass `invalid tid`.
  • Loading branch information
vitalybuka committed Oct 11, 2024
1 parent df4c913 commit 3cb4d20
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class SANITIZER_MUTEX ThreadRegistry {

// Should be guarded by ThreadRegistryLock.
ThreadContextBase *GetThreadLocked(u32 tid) {
return threads_.empty() ? nullptr : threads_[tid];
return tid < threads_.size() ? threads_[tid] : nullptr;
}

u32 NumThreadsLocked() const { return threads_.size(); }
Expand Down

0 comments on commit 3cb4d20

Please sign in to comment.