fix findall/4 (#873)

This commit is contained in:
Mark Thom
2021-03-18 12:50:12 -06:00
parent a3f0290432
commit 4623e9d7fc
2 changed files with 3 additions and 5 deletions

View File

@@ -682,9 +682,8 @@ findall(Template, Goal, Solutions) :-
). ).
% :- meta_predicate '$iterate_find_all_diff'(?, 0, ?, ?, ?).
:- non_counted_backtracking '$iterate_find_all_diff'/5. :- non_counted_backtracking '$iterate_find_all_diff'/5.
'$iterate_find_all_diff'(Template, Goal, _, _, LhOffset) :- '$iterate_find_all_diff'(Template, Goal, _, _, LhOffset) :-
call(Goal), call(Goal),
'$copy_to_lh'(LhOffset, Template), '$copy_to_lh'(LhOffset, Template),

View File

@@ -3267,8 +3267,7 @@ impl MachineState {
let solutions = self[temp_v!(2)]; let solutions = self[temp_v!(2)];
let diff = self[temp_v!(3)]; let diff = self[temp_v!(3)];
(self.unify_fn)(self, solutions, Addr::EmptyList); (self.unify_fn)(self, solutions, diff);
(self.unify_fn)(self, diff, Addr::EmptyList);
} else { } else {
let h = self.heap.h(); let h = self.heap.h();
let mut last_index = h; let mut last_index = h;