check that Target is an atom in scoped_clause_to_evacuable (#2248)
This commit is contained in:
@@ -1833,9 +1833,33 @@ impl Machine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn scoped_clause_to_evacuable(&mut self) -> CallResult {
|
pub(crate) fn scoped_clause_to_evacuable(&mut self) -> CallResult {
|
||||||
let module_name = cell_as_atom!(self
|
let target = self.deref_register(1);
|
||||||
.machine_st
|
|
||||||
.store(self.machine_st.deref(self.machine_st.registers[1])));
|
let mut permission_error = || {
|
||||||
|
let err = self.machine_st.permission_error(
|
||||||
|
Permission::Modify,
|
||||||
|
atom!("static_procedure"),
|
||||||
|
functor_stub(atom!(":"), 2)
|
||||||
|
.into_iter()
|
||||||
|
.collect::<MachineStub>(),
|
||||||
|
);
|
||||||
|
|
||||||
|
self.machine_st
|
||||||
|
.error_form(err, functor_stub(atom!("load"), 1))
|
||||||
|
};
|
||||||
|
|
||||||
|
let module_name = read_heap_cell!(target,
|
||||||
|
(HeapCellValueTag::Atom, (name, arity)) => {
|
||||||
|
if arity == 0 {
|
||||||
|
name
|
||||||
|
} else {
|
||||||
|
return Err(permission_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
return Err(permission_error());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let loader = self.loader_from_heap_evacuable(temp_v!(3));
|
let loader = self.loader_from_heap_evacuable(temp_v!(3));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user