From 703a6dddd1038a2eae7eb10724298953d33891e9 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Tue, 21 Apr 2026 16:02:55 -0700 Subject: [PATCH] dereference compare_term_test args down from stack (#3286, #3295) --- src/machine/machine_state_impl.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/machine/machine_state_impl.rs b/src/machine/machine_state_impl.rs index fdaa6aeb..80f6c61f 100644 --- a/src/machine/machine_state_impl.rs +++ b/src/machine/machine_state_impl.rs @@ -557,6 +557,11 @@ impl MachineState { } pub fn compare_term_test(&self, h1: HeapCellValue, h2: HeapCellValue) -> Option { + // all derefs downstack from this function are heap bound so + // dereference stack vars pointing into the heap while possible + let h1 = self.store(h1); + let h2 = self.store(h2); + for term_pair in ParallelHeapIter::from(self, h1, h2) { match term_pair { TermPair::Vars(v1_offset, v2_offset) if v1_offset != v2_offset => { -- 2.54.0