core/vm: improve error message for invalid opcodes

This commit is contained in:
Valentin Wüstholz 2017-05-21 12:01:07 +02:00
parent 33b158e0ed
commit 1436903f1e
2 changed files with 2 additions and 2 deletions

View file

@ -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
// during pre-homestead.
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()

View file

@ -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 !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