correct for issue #145
This commit is contained in:
@@ -797,6 +797,7 @@ pub(crate) trait CallPolicy: Any {
|
||||
} else {
|
||||
let h = machine_st.heap.h;
|
||||
let stub = MachineError::functor_stub(clause_name!("call"), arity + 1);
|
||||
|
||||
return Err(machine_st.error_form(MachineError::existence_error(h, name, arity),
|
||||
stub));
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ impl Machine {
|
||||
wam.compile_libraries();
|
||||
wam.compile_special_forms();
|
||||
wam.compile_top_level();
|
||||
|
||||
|
||||
wam
|
||||
}
|
||||
|
||||
|
||||
@@ -275,9 +275,14 @@ impl MachineState {
|
||||
},
|
||||
None =>
|
||||
match indices.code_dir.iter().next() {
|
||||
Some(((ref name, arity), _)) => {
|
||||
Some(((ref name, arity), idx)) => {
|
||||
let a2 = self[temp_v!(2)].clone();
|
||||
|
||||
if idx.is_undefined() {
|
||||
self.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(r) = a2.as_var() {
|
||||
let spec = get_clause_spec(name.clone(), *arity,
|
||||
composite_op!(&indices.op_dir));
|
||||
@@ -296,9 +301,14 @@ impl MachineState {
|
||||
let key = (name.clone(), arity);
|
||||
|
||||
match indices.code_dir.range(key ..).skip(1).next() {
|
||||
Some(((name, arity), _)) => {
|
||||
Some(((name, arity), idx)) => {
|
||||
let a2 = self[temp_v!(2)].clone();
|
||||
|
||||
if idx.is_undefined() {
|
||||
self.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(r) = a2.as_var() {
|
||||
let spec = get_clause_spec(name.clone(), *arity,
|
||||
composite_op!(&indices.op_dir));
|
||||
@@ -990,8 +1000,6 @@ impl MachineState {
|
||||
Addr::DBRef(db_ref) =>
|
||||
match db_ref {
|
||||
DBRef::Op(priority, spec, name, _, shared_op_desc) => {
|
||||
|
||||
|
||||
let prec = self[temp_v!(2)].clone();
|
||||
let specifier = self[temp_v!(3)].clone();
|
||||
let op = self[temp_v!(4)].clone();
|
||||
|
||||
Reference in New Issue
Block a user