From 28f685682cc79da4a05a6fa53c05248eaaf09e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 6 Sep 2021 19:24:19 +0200 Subject: [PATCH] deps: V8: cherry-pick 5681a6565828 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [rab/gsab] Fix missing assignment in BackingStore::Reallocate 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} Refs: https://github.com/v8/v8/commit/5681a65658285af1aa7eb28530199ceeaa430cfe --- common.gypi | 2 +- deps/v8/src/objects/backing-store.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index a4dba6841cab3b..a1778597eed3da 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.9', + 'v8_embedder_string': '-node.10', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/objects/backing-store.cc b/deps/v8/src/objects/backing-store.cc index e72698858ae8d0..7a59c2e71590f2 100644 --- a/deps/v8/src/objects/backing-store.cc +++ b/deps/v8/src/objects/backing-store.cc @@ -766,7 +766,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_); @@ -776,6 +776,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; }