gh-129430: Make walking vm regions more efficient in MacOS (#129494)

This commit is contained in:
Pablo Galindo Salgado 2025-01-31 14:08:48 +00:00 committed by GitHub
parent 79f85a0bc1
commit 7eaef74561
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -232,15 +232,15 @@ search_map_for_section(pid_t pid, const char* secname, const char* substr) {
&count,
&object_name) == KERN_SUCCESS)
{
int path_len = proc_regionfilename(
pid, address, map_filename, MAXPATHLEN);
if (path_len == 0) {
if ((region_info.protection & VM_PROT_READ) == 0
|| (region_info.protection & VM_PROT_EXECUTE) == 0) {
address += size;
continue;
}
if ((region_info.protection & VM_PROT_READ) == 0
|| (region_info.protection & VM_PROT_EXECUTE) == 0) {
int path_len = proc_regionfilename(
pid, address, map_filename, MAXPATHLEN);
if (path_len == 0) {
address += size;
continue;
}