Ver código fonte

There'll be jumping in to jumps

obscuren 11 anos atrás
pai
commit
99d5769c2b
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      vm/vm_debug.go

+ 2 - 0
vm/vm_debug.go

@@ -83,6 +83,8 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
 				nop := OpCode(closure.GetOp(p))
 				if !(nop == JUMPDEST || destinations[from.Int64()] != nil) {
 					panic(fmt.Sprintf("JUMP missed JUMPDEST (%v) %v", nop, p))
+				} else if nop == JUMP || nop == JUMPI {
+					panic(fmt.Sprintf("not allowed to JUMP(I) in to JUMP"))
 				}
 
 				pc = to