mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
core/vm: improve error message for invalid opcodes
This commit is contained in:
parent
33b158e0ed
commit
1436903f1e
2 changed files with 2 additions and 2 deletions
|
|
@ -640,7 +640,7 @@ func opDelegateCall(pc *uint64, evm *EVM, contract *Contract, memory *Memory, st
|
||||||
// if not homestead return an error. DELEGATECALL is not supported
|
// if not homestead return an error. DELEGATECALL is not supported
|
||||||
// during pre-homestead.
|
// during pre-homestead.
|
||||||
if !evm.ChainConfig().IsHomestead(evm.BlockNumber) {
|
if !evm.ChainConfig().IsHomestead(evm.BlockNumber) {
|
||||||
return nil, fmt.Errorf("invalid opcode %x", DELEGATECALL)
|
return nil, fmt.Errorf("invalid opcode 0x%x", int(DELEGATECALL))
|
||||||
}
|
}
|
||||||
|
|
||||||
gas, to, inOffset, inSize, outOffset, outSize := stack.pop().Uint64(), stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop()
|
gas, to, inOffset, inSize, outOffset, outSize := stack.pop().Uint64(), stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop()
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ func (evm *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err e
|
||||||
|
|
||||||
// if the op is invalid abort the process and return an error
|
// if the op is invalid abort the process and return an error
|
||||||
if !operation.valid {
|
if !operation.valid {
|
||||||
return nil, fmt.Errorf("invalid opcode %x", op)
|
return nil, fmt.Errorf("invalid opcode 0x%x", int(op))
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate the stack and make sure there enough stack items available
|
// validate the stack and make sure there enough stack items available
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue