From 4cb984e56d658c269764c56418d93c237e7fd4df Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 13 Jan 2025 16:58:55 +0100 Subject: [PATCH] Prevent temp arena scribbling from causing an asan warning. #1825 --- lib/std/core/allocators/temp_allocator.c3 | 2 +- releasenotes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/core/allocators/temp_allocator.c3 b/lib/std/core/allocators/temp_allocator.c3 index 6b8ac49b8..fd5626c4a 100644 --- a/lib/std/core/allocators/temp_allocator.c3 +++ b/lib/std/core/allocators/temp_allocator.c3 @@ -80,7 +80,7 @@ fn void TempAllocator.reset(&self, usz mark) @dynamic usz cleaned = self.used - mark; if (cleaned > 0) { - $if env::COMPILER_SAFE_MODE: + $if env::COMPILER_SAFE_MODE && !env::ADDRESS_SANITIZER: self.data[mark : cleaned] = 0xAA; $endif asan::poison_memory_region(&self.data[mark], cleaned); diff --git a/releasenotes.md b/releasenotes.md index fc798110b..2cdb5c99a 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -82,6 +82,7 @@ - Do not link "ld" on Linux with no libc. - Fix bug when multiple `$else` clauses followed an `$if` #1824. - Report the correct type as not having a method when access fails #1828. +- Prevent temp arena scribbling from causing an asan warning. #1825 ### Stdlib changes - Increase BitWriter.write_bits limit up to 32 bits.