add copy_term/3 (#232)

This commit is contained in:
Mark Thom
2019-11-29 00:44:23 -07:00
parent 335202b9d9
commit 9c9c484ee4
8 changed files with 81 additions and 23 deletions

View File

@@ -2044,6 +2044,7 @@ impl MachineState {
copy_term(
CopyBallTerm::new(&mut self.and_stack, &mut self.heap, &mut self.ball.stub),
addr,
AttrVarPolicy::DeepCopy,
);
}
@@ -2941,13 +2942,13 @@ impl MachineState {
}
}
pub(super) fn copy_term(&mut self) {
pub(super) fn copy_term(&mut self, attr_var_policy: AttrVarPolicy) {
let old_h = self.heap.h;
let a1 = self[temp_v!(1)].clone();
let a2 = self[temp_v!(2)].clone();
copy_term(CopyTerm::new(self), a1);
copy_term(CopyTerm::new(self), a1, attr_var_policy);
self.unify(Addr::HeapCell(old_h), a2);
}