]> Repositorios git - scryer-prolog.git/commitdiff
properly iterate over read terms in MachineState::read_term
authorMark Thom <[email protected]>
Fri, 10 Dec 2021 17:10:00 +0000 (10:10 -0700)
committerMark Thom <[email protected]>
Fri, 7 Jan 2022 04:44:41 +0000 (21:44 -0700)
src/machine/machine_state.rs
tests/scryer/issues.rs
tests/scryer/src_tests.rs

index 1ca0a784f5abc9f8d171ec057ec86a250661c8be..b09d0503c665ce27f98a5a4be9ee02eb3597d088 100644 (file)
@@ -966,8 +966,9 @@ impl MachineState {
         loop {
             match self.read(stream, &indices.op_dir) {
                 Ok(term_write_result) => {
-                    let term = self.store(self.deref(self.registers[2]));
+                    let term = self.registers[2];
                     unify_fn!(self, heap_loc_as_cell!(term_write_result.heap_loc), term);
+                    let term = heap_loc_as_cell!(term_write_result.heap_loc);
 
                     if self.fail {
                         return Ok(());
index 9932786c054ffb28df1d9dfa81dd6f9895daa1b6..bae95d738119bc4cec27c5452aad6c0bb48b4ef3 100644 (file)
@@ -143,7 +143,7 @@ fn no_stutter() {
 #[test] // FIXME: the line number is of by one (should be 4), empty line not accounted for or starting to count at line 0?
 fn singleton_warning() {
     run_top_level_test_no_args(
-        "['tests-pl/issue812-singleton-warning.pl'].\
+        "['tests-pl/issue812-singleton-warning.pl'].\n\
          halt.\n",
         "\
         Warning: singleton variables X at line 3 of issue812-singleton-warning.pl\n   \
@@ -151,7 +151,7 @@ fn singleton_warning() {
         ",
     );
 }
- */
+*/
 
 // issue #807
 #[test]
index 1730f0cd55852a3888ff954e44ae52183774320f..883d787a01d4b60c9b89f3acd824a00752472625 100644 (file)
@@ -51,7 +51,7 @@ fn rules() {
 fn setup_call_cleanup_load() {
     load_module_test(
         "src/tests/setup_call_cleanup.pl",
-        "1+21+31+2>_14278+_142791+_128721+2>41+2>_142791+2>31+2>31+2>4ba",
+        "1+21+31+2>_14304+_143051+_128981+2>41+2>_143051+2>31+2>31+2>4ba",
     );
 }
 
@@ -60,7 +60,7 @@ fn setup_call_cleanup_process() {
     run_top_level_test_with_args(
         &["src/tests/setup_call_cleanup.pl", "-f", "-g", "halt"],
         "",
-        "1+21+31+2>_15677+_156781+_142711+2>41+2>_156781+2>31+2>31+2>4ba",
+        "1+21+31+2>_15703+_157041+_142971+2>41+2>_157041+2>31+2>31+2>4ba",
     );
 }