[compiler-rt] [scudo] Compute the default aligned pointer without tag (PR #92989)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 23:32:48 PDT 2024


================
@@ -1052,6 +1052,10 @@ class Allocator {
                                 void *Block, const uptr UserPtr,
                                 const uptr SizeOrUnusedBytes,
                                 const FillContentsMode FillContents) {
+    // Compute the default pointer before adding the header tag
+    const uptr DefaultAlignedPtr =
+        reinterpret_cast<uptr>(Block) + Chunk::getHeaderSize();
+
----------------
ChiaHungDuan wrote:

Nice catch!

I think we also need to fix the `DefaultAlignedPtr` in initChunkWithMemoryTagging, right?

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


More information about the llvm-commits mailing list