]> Repositorios git - scryer-prolog.git/commitdiff
move instruction increment
authorMark Thom <[email protected]>
Thu, 18 Jan 2018 06:19:49 +0000 (23:19 -0700)
committerMark Thom <[email protected]>
Thu, 18 Jan 2018 06:19:49 +0000 (23:19 -0700)
src/prolog/machine/machine_state.rs

index aae89b190055cb1bc606ebdcc19b3ff28c6ba949..108259996ac1b7d82cf255dd13f152b7c1d6b955 100644 (file)
@@ -553,8 +553,7 @@ impl MachineState {
                             return;
                         }
 
-                        self.interms[t - 1] = Number::Integer(Rc::new(n1.div_floor(&n2)));
-                        self.p += 1;
+                        self.interms[t - 1] = Number::Integer(Rc::new(n1.div_floor(&n2)));                        
                     },
                     _ => {
                         let atom_tbl = self.atom_tbl.clone();
@@ -565,6 +564,8 @@ impl MachineState {
                         return;
                     }
                 }
+
+                self.p += 1;
             },
             &ArithmeticInstruction::IDiv(ref a1, ref a2, t) => {
                 let n1 = try_or_fail!(self, self.get_number(a1));