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 8cdddcd

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 d0868ff commit 8cdddcd
Copy full SHA for 8cdddcd

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 5
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 281
14-
#define V8_PATCH_LEVEL 98
14+
#define V8_PATCH_LEVEL 99
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
@@ -6763,7 +6763,11 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, size_t byte_length) {
67636763
ENTER_V8(i_isolate);
67646764
i::Handle<i::JSArrayBuffer> obj =
67656765
i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kNotShared);
6766-
i::JSArrayBuffer::SetupAllocatingData(obj, i_isolate, byte_length);
6766+
// TODO(jbroman): It may be useful in the future to provide a MaybeLocal
6767+
// version that throws an exception or otherwise does not crash.
6768+
if (!i::JSArrayBuffer::SetupAllocatingData(obj, i_isolate, byte_length)) {
6769+
i::FatalProcessOutOfMemory("v8::ArrayBuffer::New");
6770+
}
67676771
return Utils::ToLocal(obj);
67686772
}
67696773

@@ -6959,8 +6963,12 @@ Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(Isolate* isolate,
69596963
ENTER_V8(i_isolate);
69606964
i::Handle<i::JSArrayBuffer> obj =
69616965
i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kShared);
6962-
i::JSArrayBuffer::SetupAllocatingData(obj, i_isolate, byte_length, true,
6963-
i::SharedFlag::kShared);
6966+
// TODO(jborman): It may be useful in the future to provide a MaybeLocal
6967+
// version that throws an exception or otherwise does not crash.
6968+
if (!i::JSArrayBuffer::SetupAllocatingData(obj, i_isolate, byte_length, true,
6969+
i::SharedFlag::kShared)) {
6970+
i::FatalProcessOutOfMemory("v8::SharedArrayBuffer::New");
6971+
}
69646972
return Utils::ToLocalShared(obj);
69656973
}
69666974

0 commit comments

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