diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-16 18:36:48 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-16 18:43:14 +0800 |
commit | 4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6 (patch) | |
tree | 83afa01b7768105ad8f6b76ff13c07232f3a369e /core/vm/jump_table.go | |
parent | 9bd6068fefe5687735bed342f3545f515fa717c8 (diff) | |
download | go-tangerine-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.tar.gz go-tangerine-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.tar.zst go-tangerine-4e0fea4d30e922c1cc0e8e2f33e5ad8ae55053d6.zip |
core/vm: polish RETURNDATA, add missing returns to CALL*
Diffstat (limited to 'core/vm/jump_table.go')
-rw-r--r-- | core/vm/jump_table.go | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 7fb11021f..2d238f7a1 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -53,8 +53,8 @@ type operation struct { valid bool // reverts determined whether the operation reverts state reverts bool - // clearsReturndata determines whether the opertions clears the return data - clearsReturndata bool + // returns determines whether the opertions sets the return data + returns bool } var ( @@ -74,6 +74,7 @@ func NewMetropolisInstructionSet() [256]operation { validateStack: makeStackFunc(6, 1), memorySize: memoryStaticCall, valid: true, + returns: true, } instructionSet[RETURNDATASIZE] = operation{ execute: opReturnDataSize, @@ -101,6 +102,7 @@ func NewHomesteadInstructionSet() [256]operation { validateStack: makeStackFunc(6, 1), memorySize: memoryDelegateCall, valid: true, + returns: true, } return instructionSet } @@ -286,22 +288,22 @@ func NewFrontierInstructionSet() [256]operation { valid: true, }, CALLDATALOAD: { - execute: opCalldataLoad, + execute: opCallDataLoad, gasCost: constGasFunc(GasFastestStep), validateStack: makeStackFunc(1, 1), valid: true, }, CALLDATASIZE: { - execute: opCalldataSize, + execute: opCallDataSize, gasCost: constGasFunc(GasQuickStep), validateStack: makeStackFunc(0, 1), valid: true, }, CALLDATACOPY: { - execute: opCalldataCopy, - gasCost: gasCalldataCopy, + execute: opCallDataCopy, + gasCost: gasCallDataCopy, validateStack: makeStackFunc(3, 0), - memorySize: memoryCalldataCopy, + memorySize: memoryCallDataCopy, valid: true, }, CODESIZE: { @@ -876,29 +878,29 @@ func NewFrontierInstructionSet() [256]operation { writes: true, }, CREATE: { - execute: opCreate, - gasCost: gasCreate, - validateStack: makeStackFunc(3, 1), - memorySize: memoryCreate, - valid: true, - writes: true, - clearsReturndata: true, + execute: opCreate, + gasCost: gasCreate, + validateStack: makeStackFunc(3, 1), + memorySize: memoryCreate, + valid: true, + writes: true, + returns: true, }, CALL: { - execute: opCall, - gasCost: gasCall, - validateStack: makeStackFunc(7, 1), - memorySize: memoryCall, - valid: true, - clearsReturndata: true, + execute: opCall, + gasCost: gasCall, + validateStack: makeStackFunc(7, 1), + memorySize: memoryCall, + valid: true, + returns: true, }, CALLCODE: { - execute: opCallCode, - gasCost: gasCallCode, - validateStack: makeStackFunc(7, 1), - memorySize: memoryCall, - valid: true, - clearsReturndata: true, + execute: opCallCode, + gasCost: gasCallCode, + validateStack: makeStackFunc(7, 1), + memorySize: memoryCall, + valid: true, + returns: true, }, RETURN: { execute: opReturn, |