correct is_cyclic again for non-variable ref cells (#2116)
This commit is contained in:
@@ -273,8 +273,10 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
|
|||||||
fn is_cyclic(&self, var_current: usize, var_next: usize) -> bool {
|
fn is_cyclic(&self, var_current: usize, var_next: usize) -> bool {
|
||||||
if self.heap[var_next].is_var() {
|
if self.heap[var_next].is_var() {
|
||||||
!self.heap[var_next].get_forwarding_bit() && var_current != var_next
|
!self.heap[var_next].get_forwarding_bit() && var_current != var_next
|
||||||
|
} else if self.heap[var_next].is_ref() {
|
||||||
|
self.heap[var_next].get_mark_bit()
|
||||||
} else {
|
} else {
|
||||||
self.heap[var_next].is_ref()
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,10 @@ test("acyclic_term#2114", (
|
|||||||
A=B*B, acyclic_term(A)
|
A=B*B, acyclic_term(A)
|
||||||
)).
|
)).
|
||||||
|
|
||||||
|
test("acyclic_term#2116", (
|
||||||
|
A=B*B,B=[]*[], acyclic_term(A)
|
||||||
|
)).
|
||||||
|
|
||||||
main :-
|
main :-
|
||||||
findall(test(Name, Goal), test(Name, Goal), Tests),
|
findall(test(Name, Goal), test(Name, Goal), Tests),
|
||||||
run_tests(Tests, Failed),
|
run_tests(Tests, Failed),
|
||||||
|
|||||||
Reference in New Issue
Block a user