[PATCH] D51119: [sanitizer] Don't call task_for_pid(mach_task_self). NFC.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 23 15:56:55 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL340587: [sanitizer] Don't call task_for_pid(mach_task_self). NFC. (authored by kuba.brecka, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51119?vs=162021&id=162290#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51119

Files:
  compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc


Index: compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
===================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
+++ compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
@@ -142,12 +142,6 @@
 }
 
 void ProcessPlatformSpecificAllocations(Frontier *frontier) {
-  mach_port_name_t port;
-  if (task_for_pid(mach_task_self(), internal_getpid(), &port)
-      != KERN_SUCCESS) {
-    return;
-  }
-
   unsigned depth = 1;
   vm_size_t size = 0;
   vm_address_t address = 0;
@@ -158,7 +152,7 @@
 
   while (err == KERN_SUCCESS) {
     struct vm_region_submap_info_64 info;
-    err = vm_region_recurse_64(port, &address, &size, &depth,
+    err = vm_region_recurse_64(mach_task_self(), &address, &size, &depth,
                                (vm_region_info_t)&info, &count);
 
     uptr end_address = address + size;
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc
@@ -140,21 +140,15 @@
 // early in the process, when dyld is one of the only images loaded,
 // so it will be hit after only a few iterations.
 static mach_header *get_dyld_image_header() {
-  mach_port_name_t port;
-  if (task_for_pid(mach_task_self(), internal_getpid(), &port) !=
-      KERN_SUCCESS) {
-    return nullptr;
-  }
-
   unsigned depth = 1;
   vm_size_t size = 0;
   vm_address_t address = 0;
   kern_return_t err = KERN_SUCCESS;
   mach_msg_type_number_t count = VM_REGION_SUBMAP_INFO_COUNT_64;
 
   while (true) {
     struct vm_region_submap_info_64 info;
-    err = vm_region_recurse_64(port, &address, &size, &depth,
+    err = vm_region_recurse_64(mach_task_self(), &address, &size, &depth,
                                (vm_region_info_t)&info, &count);
     if (err != KERN_SUCCESS) return nullptr;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51119.162290.patch
Type: text/x-patch
Size: 1970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180823/dea8824b/attachment.bin>


More information about the llvm-commits mailing list