From: Mark Thom Date: Tue, 5 Feb 2019 05:56:23 +0000 (-0700) Subject: add support for copying attributed variables in copy_term X-Git-Tag: v0.8.110~273 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=3d5489496e3d3263363efbaa7d36461f24e551ef;p=scryer-prolog.git add support for copying attributed variables in copy_term --- diff --git a/src/prolog/copier.rs b/src/prolog/copier.rs index cc910200..a635ff76 100644 --- a/src/prolog/copier.rs +++ b/src/prolog/copier.rs @@ -118,18 +118,14 @@ pub(crate) trait CopierTarget: IndexMut scan += 1; }, Addr::AttrVar(h) if ra == rd => { - let threshold = self.threshold(); - + let threshold = self.threshold(); self.push(HeapCellValue::Addr(Addr::AttrVar(threshold))); let list_val = self[h+1].clone(); self.push(list_val); + self.reinstantiate_var(ra, threshold, &mut trail); self[scan] = HeapCellValue::Addr(Addr::AttrVar(threshold)); - self[h] = HeapCellValue::Addr(Addr::AttrVar(threshold)); - - trail.push((Ref::AttrVar(h), - HeapCellValue::Addr(Addr::AttrVar(h)))); }, _ if ra == rd => { self.reinstantiate_var(ra, scan, &mut trail);