diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-14 12:02:21 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-14 13:21:15 -0400 |
| commit | 5798151a0e49e6dd4f35234fe67bb3cf59700928 (patch) | |
| tree | ecaefe96ae7c5432aff7436ceab96f5163f85c10 /core/mem | |
| parent | ae96b276c144982f1ca917bec8ef90de49e5d23a (diff) | |
mem: Poison unused memory more thoroughly
Diffstat (limited to 'core/mem')
| -rw-r--r-- | core/mem/allocators.odin | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin index dfb76b101..3fafde730 100644 --- a/core/mem/allocators.odin +++ b/core/mem/allocators.odin @@ -1156,6 +1156,7 @@ stack_resize_bytes_non_zeroed :: proc( data, err := stack_alloc_bytes_non_zeroed(s, size, alignment, loc) if err == nil { runtime.copy(data, byte_slice(old_memory, old_size)) + sanitizer.address_poison(old_memory) } return data, err } @@ -1165,6 +1166,8 @@ stack_resize_bytes_non_zeroed :: proc( s.curr_offset += diff // works for smaller sizes too if diff > 0 { zero(rawptr(curr_addr + uintptr(diff)), diff) + } else { + sanitizer.address_poison(old_data[size:]) } result := byte_slice(old_memory, size) ensure_poisoned(result) |