[PATCH] D55064: Add new `__sanitizer_mz_default_zone()` API which returns the address of the ASan malloc zone. This API will be used for testing in future patches.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 29 10:00:39 PST 2018


delcypher created this revision.
delcypher added reviewers: kubamracek, george.karpenkov.
Herald added a subscriber: Sanitizers.

The name of the function is based on `malloc_default_zone()` found
in Darwin's `malloc/malloc.h` header file.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D55064

Files:
  lib/sanitizer_common/sanitizer_malloc_mac.inc


Index: lib/sanitizer_common/sanitizer_malloc_mac.inc
===================================================================
--- lib/sanitizer_common/sanitizer_malloc_mac.inc
+++ lib/sanitizer_common/sanitizer_malloc_mac.inc
@@ -265,6 +265,13 @@
   return p;
 }
 
+// This public API exists purely for testing purposes.
+extern "C"
+SANITIZER_INTERFACE_ATTRIBUTE
+malloc_zone_t* __sanitizer_mz_default_zone() {
+  return &sanitizer_zone;
+}
+
 // This function is currently unused, and we build with -Werror.
 #if 0
 void __sanitizer_mz_free_definite_size(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55064.175895.patch
Type: text/x-patch
Size: 553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181129/e78dcbad/attachment-0001.bin>


More information about the llvm-commits mailing list