fix boundary condition check in PUSH32
This commit is contained in:
parent
6d40e11fe3
commit
03dbc0a210
@ -964,8 +964,10 @@ func makePush(size uint64, pushByteSize int) executionFunc {
|
|||||||
interpreter.evm.TxContext.Accesses.TouchAddressAndChargeGas(index, nil)
|
interpreter.evm.TxContext.Accesses.TouchAddressAndChargeGas(index, nil)
|
||||||
|
|
||||||
// in the case of PUSH32, the end data might be two chunks away,
|
// in the case of PUSH32, the end data might be two chunks away,
|
||||||
// so also get the middle chunk.
|
// so also get the middle chunk. There is a boundary condition
|
||||||
if pushByteSize == 32 {
|
// check (endMin > 2) in the case the code is a single PUSH32
|
||||||
|
// insctruction, whose immediate are just 0s.
|
||||||
|
if pushByteSize == 32 && endMin > 2 {
|
||||||
chunk = uint64(endMin-2) / 31
|
chunk = uint64(endMin-2) / 31
|
||||||
count = uint64(0)
|
count = uint64(0)
|
||||||
// Look for the first code byte (i.e. no pushdata)
|
// Look for the first code byte (i.e. no pushdata)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user