浏览代码

Fixes a bug where the HALT instruction decrements PC instead of setting it to -1

Shuning Bian 2 月之前
父节点
当前提交
7f209d681e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      vm.py

+ 1 - 1
vm.py

@@ -98,7 +98,7 @@ def main():
 
         if inst.op == Instruction.OP_HALT:
             halted = True
-            pc -= 1
+            pc = -1
 
         if inst.op == Instruction.OP_STATE:
             pc += 1