mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
core/vm: fix opDataCopy
This commit is contained in:
parent
218c887878
commit
80da4fd2bb
3 changed files with 7 additions and 3 deletions
|
|
@ -693,7 +693,7 @@ func enableEOF(jt *JumpTable) {
|
||||||
dynamicGas: memoryCopierGas(2),
|
dynamicGas: memoryCopierGas(2),
|
||||||
minStack: minStack(3, 0),
|
minStack: minStack(3, 0),
|
||||||
maxStack: maxStack(3, 0),
|
maxStack: maxStack(3, 0),
|
||||||
memorySize: memoryMcopy,
|
memorySize: memoryDataCopy,
|
||||||
}
|
}
|
||||||
jt[DUPN] = &operation{
|
jt[DUPN] = &operation{
|
||||||
execute: opDupN,
|
execute: opDupN,
|
||||||
|
|
|
||||||
|
|
@ -586,7 +586,7 @@ func gasEOFCreate(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memor
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
size, overflow := stack.Back(2).Uint64WithOverflow()
|
size, overflow := stack.Back(3).Uint64WithOverflow()
|
||||||
if overflow {
|
if overflow {
|
||||||
return 0, ErrGasUintOverflow
|
return 0, ErrGasUintOverflow
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ func memoryMcopy(stack *Stack) (uint64, bool) {
|
||||||
return calcMemSize64(mStart, stack.Back(2)) // stack[2]: length
|
return calcMemSize64(mStart, stack.Back(2)) // stack[2]: length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func memoryDataCopy(stack *Stack) (uint64, bool) {
|
||||||
|
return calcMemSize64(stack.Back(0), stack.Back(2))
|
||||||
|
}
|
||||||
|
|
||||||
func memoryCreate(stack *Stack) (uint64, bool) {
|
func memoryCreate(stack *Stack) (uint64, bool) {
|
||||||
return calcMemSize64(stack.Back(1), stack.Back(2))
|
return calcMemSize64(stack.Back(1), stack.Back(2))
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +69,7 @@ func memoryCreate2(stack *Stack) (uint64, bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func memoryEOFCreate(stack *Stack) (uint64, bool) {
|
func memoryEOFCreate(stack *Stack) (uint64, bool) {
|
||||||
return calcMemSize64(stack.Back(1), stack.Back(2))
|
return calcMemSize64(stack.Back(2), stack.Back(3))
|
||||||
}
|
}
|
||||||
|
|
||||||
func memoryReturnContract(stack *Stack) (uint64, bool) {
|
func memoryReturnContract(stack *Stack) (uint64, bool) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue