Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab3fdf5

Browse filesBrowse files
ofrobotsMylesBorins
authored andcommitted
deps: cherry-pick ca0f9573 from V8 upstream
Original commit message: Trigger OOM crash if no memory returned in v8::ArrayBuffer::New and v… …8::SharedArrayBuffer::New. This API does not allow reporting failure, but we should crash rather than have the caller get an ArrayBuffer that isn't properly set up. BUG=chromium:681843 Review-Url: https://codereview.chromium.org/2641953002 Cr-Commit-Position: refs/heads/master@{#42511} PR-URL: #11940 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 54f5258 commit ab3fdf5
Copy full SHA for ab3fdf5

File tree

Expand file treeCollapse file tree

2 files changed

+12
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-4
lines changed
Open diff view settings
Collapse file

‎deps/v8/include/v8-version.h‎

Copy file name to clipboardExpand all lines: deps/v8/include/v8-version.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 103
14-
#define V8_PATCH_LEVEL 46
14+
#define V8_PATCH_LEVEL 47
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)
Collapse file

‎deps/v8/src/api.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/api.cc
+11-3Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6580,7 +6580,11 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, size_t byte_length) {
65806580
ENTER_V8(i_isolate);
65816581
i::Handle<i::JSArrayBuffer> obj =
65826582
i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kNotShared);
6583-
i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length);
6583+
// TODO(jbroman): It may be useful in the future to provide a MaybeLocal
6584+
// version that throws an exception or otherwise does not crash.
6585+
if (!i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length)) {
6586+
i::FatalProcessOutOfMemory("v8::ArrayBuffer::New");
6587+
}
65846588
return Utils::ToLocal(obj);
65856589
}
65866590

@@ -6775,8 +6779,12 @@ Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(Isolate* isolate,
67756779
ENTER_V8(i_isolate);
67766780
i::Handle<i::JSArrayBuffer> obj =
67776781
i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kShared);
6778-
i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length, true,
6779-
i::SharedFlag::kShared);
6782+
// TODO(jborman): It may be useful in the future to provide a MaybeLocal
6783+
// version that throws an exception or otherwise does not crash.
6784+
if (!i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length, true,
6785+
i::SharedFlag::kShared)) {
6786+
i::FatalProcessOutOfMemory("v8::SharedArrayBuffer::New");
6787+
}
67806788
return Utils::ToLocalShared(obj);
67816789
}
67826790

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.