From de4e49260f908ca31ee64794c89b04cb004554be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gro=C3=9F?= Date: Thu, 2 Feb 2023 15:26:01 +0100 Subject: [PATCH] [base] Fix use of deprecated function getsectdatafromheader_64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead use getsectiondata for both the 32 bit and 64 bit use case. Bug: v8:13428 Change-Id: I1efeb3bb69862ad11008a6a4a3fb08581ab7cd2e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4218733 Reviewed-by: Michael Lippautz Commit-Queue: Samuel Groß Cr-Commit-Position: refs/heads/main@{#85631} --- src/base/platform/platform-darwin.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/base/platform/platform-darwin.cc b/src/base/platform/platform-darwin.cc index bf360e3136..e4ce573ac3 100644 --- a/src/base/platform/platform-darwin.cc +++ b/src/base/platform/platform-darwin.cc @@ -48,14 +48,13 @@ std::vector OS::GetSharedLibraryAddresses() { for (unsigned int i = 0; i < images_count; ++i) { const mach_header* header = _dyld_get_image_header(i); if (header == nullptr) continue; + unsigned long size; #if V8_HOST_ARCH_I32 - unsigned int size; - char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size); + uint8_t* code_ptr = getsectiondata(header, SEG_TEXT, SECT_TEXT, &size); #else - uint64_t size; - char* code_ptr = getsectdatafromheader_64( - reinterpret_cast(header), SEG_TEXT, SECT_TEXT, - &size); + const mach_header_64* header64 = + reinterpret_cast(header); + uint8_t* code_ptr = getsectiondata(header64, SEG_TEXT, SECT_TEXT, &size); #endif if (code_ptr == nullptr) continue; const intptr_t slide = _dyld_get_image_vmaddr_slide(i);