Skip to content

Commit

Permalink
deps: cherry-pick 8957d4677aa794c230577f234071af0 from V8 upstream
Browse files Browse the repository at this point in the history
Original commit message:
	Fix GetSharedLibraryAddresses

	This patch fixes a segmentation fault which occurs when using `--prof` flag on a Darwin ARM64 architecture.
	See #36656

	Change-Id: Idc3ce6c8fd8a24f76f1b356f629e37340045b51e
	Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2609413
	Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
	Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
	Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
	Cr-Commit-Position: refs/heads/master@{#72886}

Refs: v8/v8@8957d46
Fixes: #36656

PR-URL: #37471
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
  • Loading branch information
aduh95 authored and targos committed Feb 24, 2021
1 parent 2d52dc3 commit 67dc2bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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.22',
'v8_embedder_string': '-node.23',

##### V8 defaults for Node.js #####

Expand Down
1 change: 1 addition & 0 deletions deps/v8/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Andreas Anyuru <andreas.anyuru@gmail.com>
Andrew Paprocki <andrew@ishiboo.com>
Andrei Kashcha <anvaka@gmail.com>
Anna Henningsen <anna@addaleax.net>
Antoine du Hamel <duhamelantoine1995@gmail.com>
Anton Bikineev <ant.bikineev@gmail.com>
Bangfu Tao <bangfu.tao@samsung.com>
Daniel Shelton <d1.shelton@samsung.com>
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/base/platform/platform-macos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
for (unsigned int i = 0; i < images_count; ++i) {
const mach_header* header = _dyld_get_image_header(i);
if (header == nullptr) continue;
#if V8_HOST_ARCH_X64
#if V8_HOST_ARCH_I32
unsigned int size;
char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size);
#else
uint64_t size;
char* code_ptr = getsectdatafromheader_64(
reinterpret_cast<const mach_header_64*>(header), SEG_TEXT, SECT_TEXT,
&size);
#else
unsigned int size;
char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size);
#endif
if (code_ptr == nullptr) continue;
const intptr_t slide = _dyld_get_image_vmaddr_slide(i);
Expand Down

0 comments on commit 67dc2bf

Please sign in to comment.