use in situ code directory from metacall if conventional lookup fails (#238)

This commit is contained in:
Mark Thom
2019-11-27 00:52:30 -07:00
parent 0a665b79f2
commit 1dec482e22
4 changed files with 30 additions and 39 deletions

View File

@@ -873,13 +873,7 @@ pub(crate) trait CallPolicy: Any {
if let Some(idx) = indices.get_code_index((name.clone(), arity), module) {
self.context_call(machine_st, name, arity, idx, indices)?;
} else {
let h = machine_st.heap.h;
let stub = MachineError::functor_stub(clause_name!("call"), arity + 1);
let key = ExistenceError::Procedure(name, arity);
return Err(
machine_st.error_form(MachineError::existence_error(h, key), stub)
);
try_in_situ(machine_st, name, arity, indices, machine_st.last_call)?;
}
}
ClauseType::Hook(_) | ClauseType::System(_) => {