Skip to content

Commit 422dc37

Browse files
rayw000V8 LUCI CQ
authored andcommitted
[deserialization] Remove unnecessarily limit on buffer size
1. Now there is no serializer/deserializer-specific buffer size limit. 2. Update AUTHORS Ref: nodejs/node#40059 Change-Id: Iad4c6d8f68a91ef21d3c404fb7945949e69ad9e2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3170411 Reviewed-by: Jakob Kummerow <[email protected]> Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#77084}
1 parent bd87901 commit 422dc37

File tree

3 files changed

+17
-38
lines changed

3 files changed

+17
-38
lines changed

AUTHORS

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ Alexis Campailla <[email protected]>
5757
Allan Sandfeld Jensen <[email protected]>
5858
5959
Andreas Anyuru <[email protected]>
60-
Andrew Paprocki <[email protected]>
6160
Andrei Kashcha <[email protected]>
61+
Andrew Paprocki <[email protected]>
6262
Anna Henningsen <[email protected]>
6363
Antoine du Hamel <[email protected]>
6464
Anton Bikineev <[email protected]>
6565
Bangfu Tao <[email protected]>
66-
Daniel Shelton <[email protected]>
6766
6867
Ben Newman <[email protected]>
6968
Ben Noordhuis <[email protected]>
@@ -74,18 +73,19 @@ Brice Dobry <[email protected]>
7473
Burcu Dogan <[email protected]>
7574
Caitlin Potter <[email protected]>
7675
Chao Wang <[email protected]>
77-
Craig Schlenter <[email protected]>
7876
Charles Kerr <[email protected]>
7977
Chengzhong Wu <[email protected]>
8078
Choongwoo Han <[email protected]>
8179
Chris Nardi <[email protected]>
8280
Christopher A. Taylor <[email protected]>
8381
Colin Ihrig <[email protected]>
8482
83+
Craig Schlenter <[email protected]>
8584
Daniel Andersson <[email protected]>
8685
Daniel Bevenius <[email protected]>
8786
Daniel Dromboski <[email protected]>
8887
Daniel James <[email protected]>
88+
Daniel Shelton <[email protected]>
8989
Darshan Sen <[email protected]>
9090
David Carlier <[email protected]>
9191
David Manouchehri <[email protected]>
@@ -120,13 +120,13 @@ Ingvar Stepanyan <[email protected]>
120120
Ioseb Dzmanashvili <[email protected]>
121121
Isiah Meadows <[email protected]>
122122
Jaime Bernardo <[email protected]>
123-
Jan de Mooij <[email protected]>
123+
James M Snell <[email protected]>
124+
James Pike <[email protected]>
124125
Jan Krems <[email protected]>
126+
Jan de Mooij <[email protected]>
125127
Janusz Majnert <[email protected]>
126-
Jay Freeman <[email protected]>
127-
James Pike <[email protected]>
128-
James M Snell <[email protected]>
129128
Javad Amiri <[email protected]>
129+
Jay Freeman <[email protected]>
130130
Jesper van den Ende <[email protected]>
131131
132132
Jianghua Yang <[email protected]>
@@ -136,8 +136,8 @@ Joel Stanley <[email protected]>
136136
Johan Bergström <[email protected]>
137137
Jonathan Liu <[email protected]>
138138
Julien Brianceau <[email protected]>
139-
Junha Park <[email protected]>
140139
JunHo Seo <[email protected]>
140+
Junha Park <[email protected]>
141141
Junming Huang <[email protected]>
142142
Kang-Hao (Kenny) Lu <[email protected]>
143143
Karl Skomski <[email protected]>
@@ -181,20 +181,21 @@ Oleksandr Chekhovskyi <[email protected]>
181181
Oliver Dunk <[email protected]>
182182
Paolo Giarrusso <[email protected]>
183183
Patrick Gansterer <[email protected]>
184+
Paul Lind <[email protected]>
185+
Pavel Medvedev <[email protected]>
184186
185187
186188
Peng-Yu Chen <[email protected]>
187189
Peter Rybin <[email protected]>
188190
Peter Varga <[email protected]>
189191
Peter Wong <[email protected]>
190-
Paul Lind <[email protected]>
191-
Pavel Medvedev <[email protected]>
192192
193193
Qingyan Li <[email protected]>
194194
Qiuyi Zhang <[email protected]>
195195
Rafal Krypa <[email protected]>
196196
Raul Tambre <[email protected]>
197197
Ray Glover <[email protected]>
198+
198199
Refael Ackermann <[email protected]>
199200
Rene Rebe <[email protected]>
200201
Reza Yazdani <[email protected]>
@@ -219,11 +220,13 @@ Stefan Penner <[email protected]>
219220
Stephan Hartmann <[email protected]>
220221
Stephen Belanger <[email protected]>
221222
Sylvestre Ledru <[email protected]>
223+
Takeshi Yoneda <[email protected]>
222224
Taketoshi Aono <[email protected]>
223225
Tao Liqiang <[email protected]>
224226
Teddy Katz <[email protected]>
225227
Thomas Young <[email protected]>
226228
Tiancheng "Timothy" Gu <[email protected]>
229+
Tianping Yang <[email protected]>
227230
Timo Teräs <[email protected]>
228231
Tobias Burnus <[email protected]>
229232
Tobias Nießen <[email protected]>
@@ -248,13 +251,11 @@ Yi Wang <[email protected]>
248251
Yong Wang <[email protected]>
249252
Youfeng Hao <[email protected]>
250253
251-
Yusif Khudhur <[email protected]>
252254
Yuri Iozzelli <[email protected]>
255+
Yusif Khudhur <[email protected]>
253256
Zac Hansen <[email protected]>
254257
Zeynep Cankara <[email protected]>
255258
Zhao Jiazhong <[email protected]>
256259
Zheng Liu <[email protected]>
257260
Zhongping Wang <[email protected]>
258261
柳荣一 <[email protected]>
259-
Tianping Yang <[email protected]>
260-
Takeshi Yoneda <[email protected]>

src/api/api.cc

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,6 @@ struct ValueDeserializer::PrivateData {
33693369
: isolate(i), deserializer(i, data, delegate) {}
33703370
i::Isolate* isolate;
33713371
i::ValueDeserializer deserializer;
3372-
bool has_aborted = false;
33733372
bool supports_legacy_wire_format = false;
33743373
};
33753374

@@ -3379,16 +3378,8 @@ ValueDeserializer::ValueDeserializer(Isolate* isolate, const uint8_t* data,
33793378

33803379
ValueDeserializer::ValueDeserializer(Isolate* isolate, const uint8_t* data,
33813380
size_t size, Delegate* delegate) {
3382-
if (base::IsValueInRangeForNumericType<int>(size)) {
3383-
private_ = new PrivateData(
3384-
reinterpret_cast<i::Isolate*>(isolate),
3385-
base::Vector<const uint8_t>(data, static_cast<int>(size)), delegate);
3386-
} else {
3387-
private_ =
3388-
new PrivateData(reinterpret_cast<i::Isolate*>(isolate),
3389-
base::Vector<const uint8_t>(nullptr, 0), nullptr);
3390-
private_->has_aborted = true;
3391-
}
3381+
private_ = new PrivateData(reinterpret_cast<i::Isolate*>(isolate),
3382+
base::Vector<const uint8_t>(data, size), delegate);
33923383
}
33933384

33943385
ValueDeserializer::~ValueDeserializer() { delete private_; }
@@ -3398,15 +3389,6 @@ Maybe<bool> ValueDeserializer::ReadHeader(Local<Context> context) {
33983389
ENTER_V8_NO_SCRIPT(isolate, context, ValueDeserializer, ReadHeader,
33993390
Nothing<bool>(), i::HandleScope);
34003391

3401-
// We could have aborted during the constructor.
3402-
// If so, ReadHeader is where we report it.
3403-
if (private_->has_aborted) {
3404-
isolate->Throw(*isolate->factory()->NewError(
3405-
i::MessageTemplate::kDataCloneDeserializationError));
3406-
has_pending_exception = true;
3407-
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3408-
}
3409-
34103392
bool read_header = false;
34113393
has_pending_exception = !private_->deserializer.ReadHeader().To(&read_header);
34123394
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
@@ -3430,12 +3412,10 @@ void ValueDeserializer::SetSupportsLegacyWireFormat(
34303412
}
34313413

34323414
uint32_t ValueDeserializer::GetWireFormatVersion() const {
3433-
CHECK(!private_->has_aborted);
34343415
return private_->deserializer.GetWireFormatVersion();
34353416
}
34363417

34373418
MaybeLocal<Value> ValueDeserializer::ReadValue(Local<Context> context) {
3438-
CHECK(!private_->has_aborted);
34393419
PREPARE_FOR_EXECUTION(context, ValueDeserializer, ReadValue, Value);
34403420
i::MaybeHandle<i::Object> result;
34413421
if (GetWireFormatVersion() > 0) {
@@ -3452,14 +3432,12 @@ MaybeLocal<Value> ValueDeserializer::ReadValue(Local<Context> context) {
34523432

34533433
void ValueDeserializer::TransferArrayBuffer(uint32_t transfer_id,
34543434
Local<ArrayBuffer> array_buffer) {
3455-
CHECK(!private_->has_aborted);
34563435
private_->deserializer.TransferArrayBuffer(transfer_id,
34573436
Utils::OpenHandle(*array_buffer));
34583437
}
34593438

34603439
void ValueDeserializer::TransferSharedArrayBuffer(
34613440
uint32_t transfer_id, Local<SharedArrayBuffer> shared_array_buffer) {
3462-
CHECK(!private_->has_aborted);
34633441
private_->deserializer.TransferArrayBuffer(
34643442
transfer_id, Utils::OpenHandle(*shared_array_buffer));
34653443
}

src/objects/value-serializer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ ValueDeserializer::ValueDeserializer(Isolate* isolate,
11201120
: isolate_(isolate),
11211121
delegate_(delegate),
11221122
position_(data.begin()),
1123-
end_(data.begin() + data.length()),
1123+
end_(data.end()),
11241124
id_map_(isolate->global_handles()->Create(
11251125
ReadOnlyRoots(isolate_).empty_fixed_array())) {}
11261126

0 commit comments

Comments
 (0)