Loading...
src/sanitizer_malloc.h libmalloc-474.0.13 libmalloc-715.140.5
--- libmalloc/libmalloc-474.0.13/src/sanitizer_malloc.h
+++ libmalloc/libmalloc-715.140.5/src/sanitizer_malloc.h
@@ -28,6 +28,9 @@
 #include "malloc/malloc.h"
 #include <stdbool.h>
 
+#include <malloc/_ptrcheck.h>
+__ptrcheck_abi_assume_single()
+
 MALLOC_NOEXPORT
 bool
 sanitizer_should_enable(void);
@@ -44,14 +47,14 @@
 _malloc_read_uint16_via_rsp(const void *ptr)
 {
 #if TARGET_CPU_X86_64
-    __asm__ (
-        "subq  %%rsp,       %0  \n"
-        "movw (%%rsp, %0),  %w0 \n"
-        : "+r" (ptr)            // outputs, ptr = %0 read-write
-        :                       // inputs, empty
-        :                       // clobbers, empty
-    );
-    return (uint16_t)(uintptr_t)ptr;
+	__asm__ (
+		"subq  %%rsp,       %0  \n"
+		"movw (%%rsp, %0),  %w0 \n"
+		: "+r" (ptr)            // outputs, ptr = %0 read-write
+		:                       // inputs, empty
+		:                       // clobbers, empty
+	);
+	return (uint16_t)(uintptr_t)ptr;
 #elif TARGET_CPU_ARM64 && TARGET_RT_64_BIT
 	__asm__ (
 		"sub  %0, %0, fp    \n"
@@ -62,7 +65,7 @@
 	);
 	return (uint16_t)(uintptr_t)ptr;
 #else
-    return *(uint16_t *)ptr;
+	return *(uint16_t *)ptr;
 #endif
 }
 
@@ -70,14 +73,14 @@
 _malloc_read_uint64_via_rsp(const void *ptr)
 {
 #if TARGET_CPU_X86_64
-    __asm__ (
-        "subq  %%rsp,       %0  \n"
-        "movq (%%rsp, %0),  %0  \n"
-        : "+r" (ptr)            // outputs, ptr = %0 read-write
-        :                       // inputs, empty
-        :                       // clobbers, empty
-    );
-    return (uint64_t)ptr;
+	__asm__ (
+		"subq  %%rsp,       %0  \n"
+		"movq (%%rsp, %0),  %0  \n"
+		: "+r" (ptr)            // outputs, ptr = %0 read-write
+		:                       // inputs, empty
+		:                       // clobbers, empty
+	);
+	return (uint64_t)ptr;
 #elif TARGET_CPU_ARM64 && TARGET_RT_64_BIT
 	__asm__ (
 		"sub %0, %0, fp  \n"
@@ -88,7 +91,7 @@
 	);
 	return (uint64_t)ptr;
 #else
-    return *(uint64_t *)ptr;
+	return *(uint64_t *)ptr;
 #endif
 }
 
@@ -96,13 +99,13 @@
 _malloc_write_uint64_via_rsp(void *ptr, uint64_t value)
 {
 #if TARGET_CPU_X86_64
-    __asm__ (
-        "subq  %%rsp,  %0         \n"
-        "movq  %1,    (%%rsp, %0) \n"
-        :                         // outputs, empty
-        : "r" (ptr), "r" (value)  // inputs, ptr = %0, value = %1
-        :                         // clobbers, empty
-    );
+	__asm__ (
+		"subq  %%rsp,  %0         \n"
+		"movq  %1,    (%%rsp, %0) \n"
+		:                         // outputs, empty
+		: "r" (ptr), "r" (value)  // inputs, ptr = %0, value = %1
+		:                         // clobbers, empty
+	);
 #elif TARGET_CPU_ARM64 && TARGET_RT_64_BIT
 	__asm__ volatile (
 		"sub %0, %0, fp   \n"
@@ -112,7 +115,7 @@
 		:                         // clobbers, empty
 	);
 #else
-    *(uint64_t *)ptr = value;
+	*(uint64_t *)ptr = value;
 #endif
 }