diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h index e5ae4f4e50ae1..c11fc662ab26b 100644 --- a/third_party/blink/renderer/platform/wtf/vector.h +++ b/third_party/blink/renderer/platform/wtf/vector.h @@ -1876,9 +1876,9 @@ Vector::Vector( template template Vector::Vector(base::span other) - : Base(other.size()) { + : Base(base::checked_cast(other.size())) { UNSAFE_TODO(ANNOTATE_NEW_BUFFER(data(), capacity(), other.size())); - size_ = other.size(); + size_ = static_cast(other.size()); TypeOperations::UninitializedCopy(other, base::span(*this), VectorOperationOrigin::kConstruction); } @@ -1887,7 +1887,7 @@ template template requires VectorCanAssignFromRange Vector::Vector(Range&& other, Proj proj) - : Base(std::ranges::size(other)) { + : Base(base::checked_cast(std::ranges::size(other))) { // Note that `size(other)` may become smaller if `other` is a hash table // with WeakMember keys and `Base(size(other))` above caused GC which // removed some entries from `other`, see crbug.com/40448463. This won't