From b24df6e195a6c21f99485842aa6d0a3d5f1d96c0 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Fri, 10 Dec 2021 10:10:00 -0700 Subject: [PATCH] properly iterate over read terms in MachineState::read_term --- src/machine/machine_state.rs | 3 ++- tests/scryer/issues.rs | 4 ++-- tests/scryer/src_tests.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/machine/machine_state.rs b/src/machine/machine_state.rs index 1ca0a784..b09d0503 100644 --- a/src/machine/machine_state.rs +++ b/src/machine/machine_state.rs @@ -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(()); diff --git a/tests/scryer/issues.rs b/tests/scryer/issues.rs index 9932786c..bae95d73 100644 --- a/tests/scryer/issues.rs +++ b/tests/scryer/issues.rs @@ -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] diff --git a/tests/scryer/src_tests.rs b/tests/scryer/src_tests.rs index 1730f0cd..883d787a 100644 --- a/tests/scryer/src_tests.rs +++ b/tests/scryer/src_tests.rs @@ -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", ); } -- 2.54.0