save arguments to delayed goal before calling verify_attrs (#1304)
This commit is contained in:
@@ -108,21 +108,21 @@ impl MachineState {
|
||||
attr_vars.into_iter()
|
||||
}
|
||||
|
||||
pub(super) fn verify_attr_interrupt(&mut self, p: usize) {
|
||||
self.allocate(self.num_of_args + 3);
|
||||
pub(super) fn verify_attr_interrupt(&mut self, p: usize, arity: usize) {
|
||||
self.allocate(arity + 3);
|
||||
|
||||
let e = self.e;
|
||||
let and_frame = self.stack.index_and_frame_mut(e);
|
||||
|
||||
for i in 1..self.num_of_args + 1 {
|
||||
for i in 1..arity + 1 {
|
||||
and_frame[i] = self.registers[i];
|
||||
}
|
||||
|
||||
and_frame[self.num_of_args + 1] =
|
||||
and_frame[arity + 1] =
|
||||
fixnum_as_cell!(Fixnum::build_with(self.b0 as i64));
|
||||
and_frame[self.num_of_args + 2] =
|
||||
and_frame[arity + 2] =
|
||||
fixnum_as_cell!(Fixnum::build_with(self.num_of_args as i64));
|
||||
and_frame[self.num_of_args + 3] =
|
||||
and_frame[arity + 3] =
|
||||
fixnum_as_cell!(Fixnum::build_with(self.attr_var_init.cp as i64));
|
||||
|
||||
self.verify_attributes();
|
||||
|
||||
@@ -576,7 +576,9 @@ impl Machine {
|
||||
self.machine_st.attr_var_init.cp = p;
|
||||
}
|
||||
&Instruction::VerifyAttrInterrupt => {
|
||||
self.run_verify_attr_interrupt();
|
||||
let (_, arity) = self.code[VERIFY_ATTR_INTERRUPT_LOC].to_name_and_arity();
|
||||
let arity = std::cmp::max(arity, self.machine_st.num_of_args);
|
||||
self.run_verify_attr_interrupt(arity);
|
||||
}
|
||||
&Instruction::Add(ref a1, ref a2, t) => {
|
||||
let stub_gen = || functor_stub(atom!("is"), 2);
|
||||
|
||||
@@ -511,11 +511,9 @@ impl Machine {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn run_verify_attr_interrupt(&mut self) { //, cp: usize) {
|
||||
pub(crate) fn run_verify_attr_interrupt(&mut self, arity: usize) {
|
||||
let p = self.machine_st.attr_var_init.verify_attrs_loc;
|
||||
|
||||
// self.machine_st.attr_var_init.cp = cp;
|
||||
self.machine_st.verify_attr_interrupt(p);
|
||||
self.machine_st.verify_attr_interrupt(p, arity);
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user