Skip to content

Commit 184e7bb

Browse files
dtigCommit Bot
authored andcommitted
Remove incorrect length check
The DCHECK in the lookup method compares the stashed length of the backing store and the byte_length queried on lookup. These two are not guaranteed to be equal as there can be grow calls that update the lenght of the buffer between the length being stashed and the equality check. Bug: chromium:1010272 Change-Id: I754fa0a9ab676cd838e893d12ef6b13fc7d335e1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1911490 Reviewed-by: Ulan Degenbaev <[email protected]> Commit-Queue: Deepti Gandluri <[email protected]> Cr-Commit-Position: refs/heads/master@{#65003}
1 parent 880ca11 commit 184e7bb

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/objects/backing-store.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,14 @@ std::shared_ptr<BackingStore> GlobalBackingStoreRegistry::Lookup(
629629
return std::shared_ptr<BackingStore>();
630630
}
631631
auto backing_store = result->second.lock();
632-
DCHECK_EQ(buffer_start, backing_store->buffer_start());
633-
DCHECK_EQ(length, backing_store->byte_length());
632+
CHECK_EQ(buffer_start, backing_store->buffer_start());
633+
if (backing_store->is_wasm_memory()) {
634+
// Grow calls to shared WebAssembly threads can be triggered from different
635+
// workers, length equality cannot be guaranteed here.
636+
CHECK_LE(length, backing_store->byte_length());
637+
} else {
638+
CHECK_EQ(length, backing_store->byte_length());
639+
}
634640
return backing_store;
635641
}
636642

0 commit comments

Comments
 (0)