From 548dc3f3c42c3930730cdab8fc2fcd6c3a52c58d Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Mon, 11 Dec 2023 19:06:45 -0600 Subject: [PATCH] hamt: when preserving, actually write outermost stem pointer back to mutable self --- rust/ares/src/hamt.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/ares/src/hamt.rs b/rust/ares/src/hamt.rs index 4028e82..d166d17 100644 --- a/rust/ares/src/hamt.rs +++ b/rust/ares/src/hamt.rs @@ -500,6 +500,7 @@ impl Preserve for Hamt { if stack.is_in_frame(self.0) { let dest_stem = stack.struct_alloc_in_previous_frame(1); copy_nonoverlapping(self.0, dest_stem, 1); + self.0 = dest_stem; if stack.is_in_frame((*dest_stem).buffer) { let dest_buffer = stack.struct_alloc_in_previous_frame((*dest_stem).size()); copy_nonoverlapping((*dest_stem).buffer, dest_buffer, (*dest_stem).size());