diff --git a/lib/std/core/allocators/temp_allocator.c3 b/lib/std/core/allocators/temp_allocator.c3 index 9d211a5cd..72ac77b46 100644 --- a/lib/std/core/allocators/temp_allocator.c3 +++ b/lib/std/core/allocators/temp_allocator.c3 @@ -68,6 +68,7 @@ fn void TempAllocator.reset(&self, usz mark) @dynamic TempAllocatorPage *last_page = self.last_page; while (last_page && last_page.mark > mark) { + self.used = last_page.mark; TempAllocatorPage *to_free = last_page; last_page = last_page.prev_page; self._free_page(to_free)!!; diff --git a/releasenotes.md b/releasenotes.md index 7680a3718..b642d75b8 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -36,6 +36,7 @@ - Crash invoking a `@body` argument with the wrong number of parameters. - Fix reordering semantics in struct assignment. - Regression when passing types as `#expr` arguments. #1461 +- Temp allocator overwrites data when doing reset on extra allocated pages. #1462 ### Stdlib changes - Additional init functions for hashmap.