]> Repositorios git - scryer-prolog.git/commitdiff
use indexing functions to set num_cells in allocate_and_frame/or_frame (#1877)
authorMark <[email protected]>
Tue, 11 Jul 2023 19:43:34 +0000 (13:43 -0600)
committerMark <[email protected]>
Tue, 11 Jul 2023 19:43:34 +0000 (13:43 -0600)
src/machine/mod.rs
src/machine/stack.rs

index add3be4efcbe88aa4721e0e3ab79f9b21619e2c0..78c347f2927dfa919182887de8266ba62440eae2 100644 (file)
@@ -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;
index cc86aa34eec7fe9d4e33d97dd612013f86edf2fd..1e15e69d59760657358553e249b14b2bf6bb17bc 100644 (file)
@@ -202,7 +202,7 @@ impl Stack {
                 offset += mem::size_of::<HeapCellValue>();
             }
 
-            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::<HeapCellValue>();
             }
 
-            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