Skip to content

Commit efd9049

Browse files
author
matinzd
committed
[aarm64] Fix GetSharedLibraryAddresses
This patch fixes a segmentation fault which occurs when using `--prof` flag on a Darwin ARM64 architecture. ref: https://chromium-review.googlesource.com/c/v8/v8/+/2609413
1 parent b5563f6 commit efd9049

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/v8/src/base/platform/platform-macos.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
4949
for (unsigned int i = 0; i < images_count; ++i) {
5050
const mach_header* header = _dyld_get_image_header(i);
5151
if (header == nullptr) continue;
52-
#if V8_HOST_ARCH_X64
52+
#if V8_HOST_ARCH_I32
53+
unsigned int size;
54+
char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size);
55+
#else
5356
uint64_t size;
5457
char* code_ptr = getsectdatafromheader_64(
5558
reinterpret_cast<const mach_header_64*>(header), SEG_TEXT, SECT_TEXT,
5659
&size);
57-
#else
58-
unsigned int size;
59-
char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size);
6060
#endif
6161
if (code_ptr == nullptr) continue;
6262
const intptr_t slide = _dyld_get_image_vmaddr_slide(i);

0 commit comments

Comments
 (0)