From 4b9cf0952edcb8f0b29f245b6462b762bb1714df Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 9 Oct 2023 11:38:01 -0600 Subject: [PATCH] do not push stack variables to the heap in term_variables (#2087) --- src/machine/system_calls.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index ba211683..359e8e9a 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -6872,6 +6872,17 @@ impl Machine { return; } + let stored_v = if stored_v.is_stack_var() { + let h = self.machine_st.heap.len(); + + self.machine_st.heap.push(heap_loc_as_cell!(h)); + self.machine_st.bind(Ref::heap_cell(h), stored_v); + + heap_loc_as_cell!(h) + } else { + stored_v + }; + let mut seen_set = IndexSet::with_hasher(FxBuildHasher::default()); self.machine_st.variable_set(&mut seen_set, stored_v); -- 2.54.0