throw exception when predicate not found

This commit is contained in:
Mark Thom
2018-04-09 21:27:50 -06:00
parent fe481fedce
commit ed9cca0750
4 changed files with 20 additions and 199 deletions

View File

@@ -925,6 +925,13 @@ impl MachineState {
self.p = CodePtr::DirEntry(59, clause_name!("builtin"));
}
fn unwind_stack(&mut self) {
self.b = self.block;
self.or_stack.truncate(self.b);
self.fail = true;
}
fn throw_exception(&mut self, hcv: Vec<HeapCellValue>) {
let h = self.heap.h;
@@ -1535,12 +1542,8 @@ impl MachineState {
let addr = self.deref(self[temp_v!(1)].clone());
self.reset_block(addr);
},
&BuiltInInstruction::UnwindStack => {
self.b = self.block;
self.or_stack.truncate(self.b);
self.fail = true;
},
&BuiltInInstruction::UnwindStack =>
self.unwind_stack(),
&BuiltInInstruction::InternalCallN =>
self.handle_internal_call_n(call_policy, code_dirs),
&BuiltInInstruction::Fail => {