[compiler-rt] Reland: [ASan][Windows] Fix memmove/memcpy interception on x64 (#192060) (PR #193633)
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 06:28:45 PDT 2026
================
@@ -234,11 +234,44 @@ INTERCEPTOR(void *, bzero, void *block, usize size) {
#endif // SANITIZER_INTERCEPT_BZERO
namespace __sanitizer {
+
+#if SANITIZER_WINDOWS64
+// On Windows x64, memcpy and memmove used to share a single implementation in
+// the CRT (vcruntime140.dll), but newer CRTs ship them as distinct functions.
+// Detect this at interceptor init time so the rest of the runtime can pick the
+// right code path (e.g. asan_allocator's Reallocate). See
+// InitializeMemintrinsicInterceptors below.
+bool win64_memcpy_memmove_are_disjoint;
----------------
aganea wrote:
Yes, I dropped the global and use that directly - `REAL(memcpy) != REAL(memmove)`.
https://github.com/llvm/llvm-project/pull/193633
More information about the llvm-commits
mailing list