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 {
|
||||
if self.heap[var_next].is_var() {
|
||||
!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 {
|
||||
self.heap[var_next].is_ref()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,10 @@ test("acyclic_term#2114", (
|
||||
A=B*B, acyclic_term(A)
|
||||
)).
|
||||
|
||||
test("acyclic_term#2116", (
|
||||
A=B*B,B=[]*[], acyclic_term(A)
|
||||
)).
|
||||
|
||||
main :-
|
||||
findall(test(Name, Goal), test(Name, Goal), Tests),
|
||||
run_tests(Tests, Failed),
|
||||
|
||||
Reference in New Issue
Block a user