[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt] Fix definition of `usize` on 32-bit Windows (PR #106303)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 27 16:10:06 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: None (llvmbot)
<details>
<summary>Changes</summary>
Backport bb27dd853a713866c025a94ead8f03a1e25d1b6e
Requested by: @<!-- -->arichardson
---
Full diff: https://github.com/llvm/llvm-project/pull/106303.diff
1 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h (+9)
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index 294e330c4d5611..eebfb00aad7acd 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -194,7 +194,16 @@ typedef u64 OFF64_T;
#ifdef __SIZE_TYPE__
typedef __SIZE_TYPE__ usize;
#else
+// Since we use this for operator new, usize must match the real size_t, but on
+// 32-bit Windows the definition of uptr does not actually match uintptr_t or
+// size_t because we are working around typedef mismatches for the (S)SIZE_T
+// types used in interception.h.
+// Until the definition of uptr has been fixed we have to special case Win32.
+# if SANITIZER_WINDOWS && SANITIZER_WORDSIZE == 32
+typedef unsigned int usize;
+# else
typedef uptr usize;
+# endif
#endif
typedef u64 tid_t;
``````````
</details>
https://github.com/llvm/llvm-project/pull/106303
More information about the llvm-branch-commits
mailing list