core/vm: fix opExt{*}Call address space extension

This commit is contained in:
Marius van der Wijden 2024-06-28 10:37:48 +02:00
parent 03b75144b9
commit 218c887878

View file

@ -1130,6 +1130,9 @@ func opExtDelegateCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCont
// Pop other call parameters. // Pop other call parameters.
addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop() addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop()
toAddr := common.Address(addr.Bytes20()) toAddr := common.Address(addr.Bytes20())
if addr.ByteLen() > 20 {
return nil, errors.New("address space extension")
}
// safe a memory alloc // safe a memory alloc
temp := addr temp := addr
// Get arguments from the memory. // Get arguments from the memory.
@ -1173,6 +1176,9 @@ func opExtStaticCall(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContex
// Pop other call parameters. // Pop other call parameters.
addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop() addr, inOffset, inSize := stack.pop(), stack.pop(), stack.pop()
toAddr := common.Address(addr.Bytes20()) toAddr := common.Address(addr.Bytes20())
if addr.ByteLen() > 20 {
return nil, errors.New("address space extension")
}
// safe a memory alloc // safe a memory alloc
temp := addr temp := addr
// Get arguments from the memory. // Get arguments from the memory.