-
Notifications
You must be signed in to change notification settings - Fork 15k
/
fix_disable_implies_dcheck_for_node_stream_array_buffers.patch
36 lines (30 loc) · 1.65 KB
/
fix_disable_implies_dcheck_for_node_stream_array_buffers.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <khammond@slack-corp.com>
Date: Thu, 29 Jul 2021 17:05:32 -0700
Subject: fix: disable implies dcheck for node stream array buffers
Added in this CL: https://chromium-review.googlesource.com/c/v8/v8/+/3035091
This commit was added in preparation for ResizableArrayBuffers
and GrowableSharedArrayBuffer. If a buffer is not resizable and
has a larger max_byte_length than byte_length, we throw.
However, the check also catches on Node stream buffers, which
on readStream will slowly fill their byte length up to the
maximum length. Streams do not yet have the resizable
property.
This patch can be removed when streams support rab/gsab, or
when support is synchronized across both v8 and node.
diff --git a/src/objects/js-array-buffer.cc b/src/objects/js-array-buffer.cc
index f2563ef61d3f5bc2d866f8c3366ca6c9ef8357a6..ed6180e28467df90ed8d91093ae9269a24e919db 100644
--- a/src/objects/js-array-buffer.cc
+++ b/src/objects/js-array-buffer.cc
@@ -72,9 +72,9 @@ void JSArrayBuffer::Attach(std::shared_ptr<BackingStore> backing_store) {
DCHECK_NOT_NULL(backing_store);
DCHECK_EQ(is_shared(), backing_store->is_shared());
DCHECK_EQ(is_resizable(), backing_store->is_resizable());
- DCHECK_IMPLIES(
- !backing_store->is_wasm_memory() && !backing_store->is_resizable(),
- backing_store->byte_length() == backing_store->max_byte_length());
+ // DCHECK_IMPLIES(
+ // !backing_store->is_wasm_memory() && !backing_store->is_resizable(),
+ // backing_store->byte_length() == backing_store->max_byte_length());
DCHECK(!was_detached());
Isolate* isolate = GetIsolate();