]> Repositorios git - scryer-prolog.git/commitdiff
restore more tabu_list use to compare_term_tests (#2633)
authorMark Thom <[email protected]>
Fri, 11 Apr 2025 04:06:44 +0000 (21:06 -0700)
committerMark Thom <[email protected]>
Wed, 23 Apr 2025 06:33:11 +0000 (23:33 -0700)
src/machine/machine_state_impl.rs

index 58535f030b349ddc1de981e95868a46fb4df1dce..d2dfc18de08d325c693b201eabb99362a54af154 100644 (file)
@@ -628,6 +628,12 @@ impl MachineState {
                         (HeapCellValueTag::PStrLoc, l1) => {
                             read_heap_cell!(v2,
                                 (HeapCellValueTag::PStrLoc, l2) => {
+                                    if tabu_list.contains(&(l1, l2)) {
+                                        continue;
+                                    }
+
+                                    tabu_list.insert((l1, l2));
+
                                     match self.heap.compare_pstr_segments(l1, l2) {
                                         PStrSegmentCmpResult::Continue(v1, v2) => {
                                             self.pdl.push(v1);
@@ -642,6 +648,12 @@ impl MachineState {
                                     }
                                 }
                                 (HeapCellValueTag::Lis, l2) => {
+                                    if tabu_list.contains(&(l1, l2)) {
+                                        continue;
+                                    }
+
+                                    tabu_list.insert((l1, l2));
+
                                     let (c, succ_cell) = self.heap.last_str_char_and_tail(l1);
 
                                     self.pdl.push(succ_cell);
@@ -651,10 +663,16 @@ impl MachineState {
                                     self.pdl.push(heap_loc_as_cell!(l2));
                                 }
                                 (HeapCellValueTag::Str, s) => {
+                                    if tabu_list.contains(&(l1, s)) {
+                                        continue;
+                                    }
+
                                     let (name, arity) = cell_as_atom_cell!(self.heap[s])
                                         .get_name_and_arity();
 
                                     if name == atom!(".") && arity == 2 {
+                                        tabu_list.insert((l1, s));
+
                                         let (c, succ_cell) = self.heap.last_str_char_and_tail(l1);
 
                                         self.pdl.push(heap_loc_as_cell!(s+2));