diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-08-16 20:32:59 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-16 20:32:59 +0800 |
commit | b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3 (patch) | |
tree | 48364d1e6576be345fb97e44afb3d5c00eb7e9ac /core/vm/instructions.go | |
parent | 0b978f91b6adcc4b595391096a72db73bc625bcf (diff) | |
download | go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar.gz go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar.bz2 go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar.lz go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar.xz go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.tar.zst go-tangerine-b70a73cd3e49e249a9ab2c41c2dd268786dcd1a3.zip |
core/vm: implement REVERT metropolis opcode
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r-- | core/vm/instructions.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 4d6197912..b3b7310dd 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -718,7 +718,14 @@ func opReturn(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *S ret := memory.GetPtr(offset.Int64(), size.Int64()) evm.interpreter.intPool.put(offset, size) + return ret, nil +} +func opRevert(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { + offset, size := stack.pop(), stack.pop() + ret := memory.GetPtr(offset.Int64(), size.Int64()) + + evm.interpreter.intPool.put(offset, size) return ret, nil } @@ -731,7 +738,6 @@ func opSuicide(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack * evm.StateDB.AddBalance(common.BigToAddress(stack.pop()), balance) evm.StateDB.Suicide(contract.Address()) - return nil, nil } |