]> Repositorios git - scryer-prolog.git/commitdiff
unify partial string tail later in create_partial_string (#1462, #1465, #1427)
authorMark Thom <[email protected]>
Sun, 8 May 2022 20:52:22 +0000 (14:52 -0600)
committerMark Thom <[email protected]>
Sun, 8 May 2022 20:52:22 +0000 (14:52 -0600)
src/machine/machine_state_impl.rs
src/machine/system_calls.rs

index ed235673cbedf2fc6d80b99c597e1ebda6911db2..a2940ecee25c5fa734c178b4e462ab22704375b6 100644 (file)
@@ -532,8 +532,8 @@ impl MachineState {
 
                     chars_iter.iter.next();
 
-                    self.pdl.push(chars_iter.iter.focus);
                     self.pdl.push(focus);
+                    self.pdl.push(chars_iter.iter.focus);
 
                     break;
                 }
index e34b6ccb9ea5a4b4e8a60c2f7bcc89f592b51f71..6272bcee9b9b549a906605026aa98909f6ca4304 100644 (file)
@@ -1460,7 +1460,8 @@ impl Machine {
         unify!(self.machine_st, self.machine_st.registers[2], pstr_loc_as_cell!(pstr_h));
 
         if !self.machine_st.fail {
-            self.machine_st.bind(Ref::heap_cell(pstr_h+1), self.machine_st.registers[3]);
+            let tail = self.machine_st.registers[3];
+            unify!(self.machine_st, tail, heap_loc_as_cell!(pstr_h+1));
         }
     }