From: Mark Date: Tue, 11 Jul 2023 19:43:34 +0000 (-0600) Subject: use indexing functions to set num_cells in allocate_and_frame/or_frame (#1877) X-Git-Tag: v0.9.2~70 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=bb420e934716e6816efef494a60eb7eb9777ad60;p=scryer-prolog.git use indexing functions to set num_cells in allocate_and_frame/or_frame (#1877) --- diff --git a/src/machine/mod.rs b/src/machine/mod.rs index add3be4e..78c347f2 100644 --- a/src/machine/mod.rs +++ b/src/machine/mod.rs @@ -690,8 +690,6 @@ impl Machine { fn try_call(&mut self, name: Atom, arity: usize, idx: IndexPtr) -> CallResult { let compiled_tl_index = idx.p() as usize; - // println!("calling {}/{}", name.as_str(), arity); - match idx.tag() { IndexPtrTag::DynamicUndefined => { self.machine_st.fail = true; @@ -715,8 +713,6 @@ impl Machine { fn try_execute(&mut self, name: Atom, arity: usize, idx: IndexPtr) -> CallResult { let compiled_tl_index = idx.p() as usize; - // println!("executing {}/{}", name.as_str(), arity); - match idx.tag() { IndexPtrTag::DynamicUndefined => { self.machine_st.fail = true; diff --git a/src/machine/stack.rs b/src/machine/stack.rs index cc86aa34..1e15e69d 100644 --- a/src/machine/stack.rs +++ b/src/machine/stack.rs @@ -202,7 +202,7 @@ impl Stack { offset += mem::size_of::(); } - let and_frame = &mut *(new_ptr as *mut AndFrame); + let and_frame = self.index_and_frame_mut(e); and_frame.prelude.num_cells = num_cells; e @@ -226,7 +226,7 @@ impl Stack { offset += mem::size_of::(); } - let or_frame = &mut *(new_ptr as *mut OrFrame); + let or_frame = self.index_or_frame_mut(b); or_frame.prelude.num_cells = num_cells; b