Commit 95db6d6b authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix sign/unsigned mismatch in ElementsAccessorBase.

Found by MSVC. Cast the std::numeric_limits() result to size_t to make
the two sides of the comparison match.

Change-Id: Id480b973aad927315ae174003bf2e9ae182cd585
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1960905
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65413}
parent 8c050b75
......@@ -1278,7 +1278,9 @@ class ElementsAccessorBase : public InternalElementsAccessor {
IsAnyNonextensibleElementsKind(kind()));
size_t length = Subclass::GetMaxIndex(holder, backing_store);
if (IsHoleyElementsKindForRead(kind())) {
DCHECK_IMPLIES(index < length, index <= std::numeric_limits<int>::max());
DCHECK_IMPLIES(
index < length,
index <= static_cast<size_t>(std::numeric_limits<int>::max()));
return index < length &&
!BackingStore::cast(backing_store)
.is_the_hole(isolate, static_cast<int>(index))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment