diff options
Diffstat (limited to 'core/vm/vm.go')
-rw-r--r-- | core/vm/vm.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/core/vm/vm.go b/core/vm/vm.go index 6db99bdcc..0d8facbb6 100644 --- a/core/vm/vm.go +++ b/core/vm/vm.go @@ -72,17 +72,16 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { } var ( - op OpCode - - destinations = analyseJumpDests(context.Code) - mem = NewMemory() - stack = newStack() - pc = new(big.Int) - statedb = self.env.State() + op OpCode + codehash = crypto.Sha3Hash(code) + mem = NewMemory() + stack = newStack() + pc = new(big.Int) + statedb = self.env.State() jump = func(from *big.Int, to *big.Int) error { - nop := context.GetOp(to) - if !destinations.Has(to) { + if !context.jumpdests.has(codehash, code, to) { + nop := context.GetOp(to) return fmt.Errorf("invalid jump destination (%v) %v", nop, to) } |