core/vm: fix opRJumpV

This commit is contained in:
Marius van der Wijden 2024-06-25 12:11:07 +02:00
parent 19e296506a
commit fa6b1b9fa1

View file

@ -799,7 +799,7 @@ func opRjumpi(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]b
func opRjumpv(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) { func opRjumpv(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
var ( var (
code = scope.Contract.CodeAt(scope.CodeSection) code = scope.Contract.CodeAt(scope.CodeSection)
count = uint64(code[*pc+1]) count = uint64(code[*pc+1]) + 1
idx = scope.Stack.pop() idx = scope.Stack.pop()
) )
if idx, overflow := idx.Uint64WithOverflow(); overflow || idx >= count { if idx, overflow := idx.Uint64WithOverflow(); overflow || idx >= count {