From 5681a65658285af1aa7eb28530199ceeaa430cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Mon, 6 Sep 2021 10:01:42 +0200 Subject: [PATCH] [rab/gsab] Fix missing assignment in BackingStore::Reallocate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/nodejs/node/pull/39945 Bug: v8:11111 Change-Id: I7271a907bf036c18a014b2a13ff5746db622456a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141581 Reviewed-by: Leszek Swirski Commit-Queue: Marja Hölttä Cr-Commit-Position: refs/heads/main@{#76670} --- src/objects/backing-store.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objects/backing-store.cc b/src/objects/backing-store.cc index fa840b67fc22..836ad3e71da8 100644 --- a/src/objects/backing-store.cc +++ b/src/objects/backing-store.cc @@ -796,7 +796,7 @@ std::unique_ptr BackingStore::EmptyBackingStore( bool BackingStore::Reallocate(Isolate* isolate, size_t new_byte_length) { CHECK(!is_wasm_memory_ && !custom_deleter_ && !globally_registered_ && - free_on_destruct_); + free_on_destruct_ && !is_resizable_); auto allocator = get_v8_api_array_buffer_allocator(); CHECK_EQ(isolate->array_buffer_allocator(), allocator); CHECK_EQ(byte_length_, byte_capacity_); @@ -806,6 +806,7 @@ bool BackingStore::Reallocate(Isolate* isolate, size_t new_byte_length) { buffer_start_ = new_start; byte_capacity_ = new_byte_length; byte_length_ = new_byte_length; + max_byte_length_ = new_byte_length; return true; }