correct bugs in verify_attributes handling

This commit is contained in:
Mark Thom
2019-02-09 00:16:57 -07:00
parent 661f9b7414
commit 33dbe3bb45
6 changed files with 70 additions and 31 deletions

View File

@@ -451,7 +451,16 @@ impl MachineState {
mem::swap(&mut bindings, &mut self.attr_var_init.bindings);
for (h, addr) in bindings {
self.heap[h] = HeapCellValue::Addr(addr);
let deref_h = self.store(self.deref(Addr::AttrVar(h)));
if &Addr::AttrVar(h) != &deref_h {
if &deref_h != &addr {
self.fail = true;
return Ok(());
}
} else {
self.heap[h] = HeapCellValue::Addr(addr);
}
}
return Ok(());