do not traverse data structures when binding to local variables in unify_with_occurs_check (#781)

This commit is contained in:
Mark Thom
2021-02-03 11:11:22 -07:00
parent 137b0cd837
commit f5d808e68f

View File

@@ -201,6 +201,14 @@ impl MachineState {
}
fn bind_with_occurs_check(&mut self, r: Ref, addr: Addr) {
if let Ref::StackCell(..) = r {
// local variable optimization -- r cannot occur in the
// data structure bound to addr, so don't bother
// traversing it.
self.bind(r, addr);
return;
}
let mut fail = false;
for addr in self.acyclic_pre_order_iter(addr) {