[compiler-rt] [scudo] Add hooks to mark the range of realloc (PR #74353)

Fabio D'Urso via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 08:48:51 PST 2023


================
@@ -27,15 +27,21 @@ static void reportDeallocation(void *ptr) {
     if (__scudo_deallocate_hook)
       __scudo_deallocate_hook(ptr);
 }
-static void reportReallocBegin(void *old_ptr) {
-  if (SCUDO_ENABLE_HOOKS)
-    if (__scudo_realloc_begin_hook)
-      __scudo_realloc_begin_hook(old_ptr);
+static void reportReallocAllocation(void *old_ptr, void *new_ptr, size_t size) {
+  if (SCUDO_ENABLE_HOOKS) {
+    if (__scudo_realloc_allocate_hook)
+      __scudo_realloc_allocate_hook(old_ptr, new_ptr, size);
+    else
----------------
fabio-d wrote:

I think we want this to be `else if (__scudo_allocate_hook && new_ptr)`

https://github.com/llvm/llvm-project/pull/74353


More information about the llvm-commits mailing list