Skip to content

Commit 5d98479

Browse files
authored
core: using math.MaxUint64 instead of 0xffffffffffffffff (#29022)
1 parent 034bc46 commit 5d98479

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/vm/instructions.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package vm
1818

1919
import (
20+
"math"
21+
2022
"github.com/ethereum/go-ethereum/common"
2123
"github.com/ethereum/go-ethereum/core/types"
2224
"github.com/ethereum/go-ethereum/crypto"
@@ -359,7 +361,7 @@ func opCodeCopy(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([
359361
)
360362
uint64CodeOffset, overflow := codeOffset.Uint64WithOverflow()
361363
if overflow {
362-
uint64CodeOffset = 0xffffffffffffffff
364+
uint64CodeOffset = math.MaxUint64
363365
}
364366
codeCopy := getData(scope.Contract.Code, uint64CodeOffset, length.Uint64())
365367
scope.Memory.Set(memOffset.Uint64(), length.Uint64(), codeCopy)
@@ -377,7 +379,7 @@ func opExtCodeCopy(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
377379
)
378380
uint64CodeOffset, overflow := codeOffset.Uint64WithOverflow()
379381
if overflow {
380-
uint64CodeOffset = 0xffffffffffffffff
382+
uint64CodeOffset = math.MaxUint64
381383
}
382384
addr := common.Address(a.Bytes20())
383385
codeCopy := getData(interpreter.evm.StateDB.GetCode(addr), uint64CodeOffset, length.Uint64())

0 commit comments

Comments
 (0)