Commit f955ebf6 authored by erikchen's avatar erikchen Committed by Commit bot

macOS: Fix a bug in logic to get all memory regions.

The logic was accidentally double-counting the size of a memory region, causing
some memory regions to get skipped.

BUG=706547

Review-Url: https://codereview.chromium.org/2786733004
Cr-Commit-Position: refs/heads/master@{#460585}
parent 6ff2dbc1
......@@ -430,7 +430,8 @@ bool GetAllRegions(std::vector<VMRegion>* regions) {
vm_region_submap_info_64 info;
natural_t depth = 1;
mach_msg_type_number_t count = sizeof(info);
for (mach_vm_address_t address = MACH_VM_MIN_ADDRESS;; address += size) {
mach_vm_address_t address = MACH_VM_MIN_ADDRESS;
while (true) {
memset(&info, 0, sizeof(info));
kern_return_t kr = mach_vm_region_recurse(
task, &address, &size, &depth,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment