properly iterate over read terms in MachineState::read_term

This commit is contained in:
Mark Thom
2021-12-10 10:10:00 -07:00
parent bcd33dc8e3
commit b24df6e195
3 changed files with 6 additions and 5 deletions

View File

@@ -966,8 +966,9 @@ impl MachineState {
loop { loop {
match self.read(stream, &indices.op_dir) { match self.read(stream, &indices.op_dir) {
Ok(term_write_result) => { 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); 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 { if self.fail {
return Ok(()); return Ok(());

View 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? #[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() { fn singleton_warning() {
run_top_level_test_no_args( run_top_level_test_no_args(
"['tests-pl/issue812-singleton-warning.pl'].\ "['tests-pl/issue812-singleton-warning.pl'].\n\
halt.\n", halt.\n",
"\ "\
Warning: singleton variables X at line 3 of issue812-singleton-warning.pl\n \ Warning: singleton variables X at line 3 of issue812-singleton-warning.pl\n \
@@ -151,7 +151,7 @@ fn singleton_warning() {
", ",
); );
} }
*/ */
// issue #807 // issue #807
#[test] #[test]

View File

@@ -51,7 +51,7 @@ fn rules() {
fn setup_call_cleanup_load() { fn setup_call_cleanup_load() {
load_module_test( load_module_test(
"src/tests/setup_call_cleanup.pl", "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( run_top_level_test_with_args(
&["src/tests/setup_call_cleanup.pl", "-f", "-g", "halt"], &["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",
); );
} }