fix:overflow

This commit is contained in:
zgfzgf 2024-03-20 10:47:15 +08:00
parent 4c1b57856f
commit 12dce57b4f

View file

@ -66,7 +66,7 @@ func (it *instructionIterator) Next() bool {
it.op = vm.OpCode(it.code[it.pc])
if it.op.IsPush() {
a := uint64(it.op) - uint64(vm.PUSH1) + 1
a := uint64(it.op) + 1 - uint64(vm.PUSH1)
u := it.pc + 1 + a
if uint64(len(it.code)) <= it.pc || uint64(len(it.code)) < u {
it.error = fmt.Errorf("incomplete push instruction at %v", it.pc)