[compiler-rt] [compiler-rt][asan] _aligned_malloc/_aligned_free interception. (PR #82049)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 08:34:57 PST 2024


================
@@ -173,8 +200,17 @@ __declspec(dllexport) void *__cdecl __asan_recalloc(void *const ptr,
   return _recalloc(ptr, nmemb, size);
 }
 
-// TODO(timurrrr): Might want to add support for _aligned_* allocation
-// functions to detect a bit more bugs.  Those functions seem to wrap malloc().
+__declspec(dllexport) void *__cdecl __asan_aligned_malloc(const size_t size,
+							  const size_t alignment) {
+  return _aligned_malloc(size, alignment);
+}
+
+__declspec(dllexport) void *__cdecl __asan_aligned_realloc(
----------------
zmodem wrote:

nit: Formatting looks off.

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


More information about the llvm-commits mailing list