add error value to occurs_check prolog flag (#783)

This commit is contained in:
Mark Thom
2021-02-28 11:44:07 -07:00
parent 81ecd17b93
commit 101ed9a633
6 changed files with 65 additions and 12 deletions

View File

@@ -5439,6 +5439,12 @@ impl MachineState {
HeapCellValue::Atom(clause_name!("true"), None),
);
(self.unify_fn)(self, self[temp_v!(1)], value);
} else if self.unify_fn as usize == MachineState::unify_with_occurs_check_with_error as usize {
let value = self.heap.to_unifiable(
HeapCellValue::Atom(clause_name!("error"), None),
);
(self.unify_fn)(self, self[temp_v!(1)], value);
} else {
let value = self.heap.to_unifiable(
@@ -5454,6 +5460,9 @@ impl MachineState {
&SystemClauseType::SetNSTOAsUnify => {
self.unify_fn = MachineState::unify;
}
&SystemClauseType::SetSTOWithErrorAsUnify => {
self.unify_fn = MachineState::unify_with_occurs_check_with_error;
}
&SystemClauseType::HomeDirectory => {
let path = match dirs_next::home_dir() {
Some(path) => path,