From 676afdc6fc3a9f5ccb25103da4fed6894f3edd18 Mon Sep 17 00:00:00 2001 From: bluurryy <164359728+bluurryy@users.noreply.github.com> Date: Sun, 19 May 2024 02:40:02 +0200 Subject: [PATCH] Fixed stacked borrows violation in `dealloc` (fixes #247) --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index b23cfea..aa9d844 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -1705,6 +1705,7 @@ impl Bump { // If the pointer is the last allocation we made, we can reuse the bytes, // otherwise they are simply leaked -- at least until somebody calls reset(). if self.is_last_allocation(ptr) { + let ptr = self.current_chunk_footer.get().as_ref().ptr.get(); let ptr = NonNull::new_unchecked(ptr.as_ptr().add(layout.size())); self.current_chunk_footer.get().as_ref().ptr.set(ptr); }