diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-21 12:33:51 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-21 12:34:02 +0800 |
commit | fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9 (patch) | |
tree | 61ad29780014ad56af1578f9cedde52460a39f52 /vm/vm.go | |
parent | bba7ccb07f08e0c6ad404abfb363deaec1db5fab (diff) | |
download | go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar.gz go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar.bz2 go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar.lz go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar.xz go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.tar.zst go-tangerine-fd3793b8cf04e2ca78b9c0a01844a09aa25b91e9.zip |
Correct stack size validation for MUL, CALLDATACOPY, EXTCODESIZE, BLOCKHASH
Diffstat (limited to 'vm/vm.go')
-rw-r--r-- | vm/vm.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -779,9 +779,9 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo // Stack Check, memory resize & gas phase switch op { // Stack checks only - case ISZERO, CALLDATALOAD, POP, JUMP, NOT: // 1 + case ISZERO, CALLDATALOAD, POP, JUMP, NOT, EXTCODESIZE, BLOCKHASH: // 1 stack.require(1) - case JUMPI, ADD, SUB, DIV, SDIV, MOD, SMOD, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE, SIGNEXTEND: // 2 + case JUMPI, ADD, SUB, DIV, MUL, SDIV, MOD, SMOD, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE, SIGNEXTEND: // 2 stack.require(2) case ADDMOD, MULMOD: // 3 stack.require(3) @@ -859,7 +859,7 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo newMemSize = calcMemSize(stack.Peek(), stack.data[stack.Len()-2]) additionalGas.Set(stack.data[stack.Len()-2]) case CALLDATACOPY: - stack.require(2) + stack.require(3) newMemSize = calcMemSize(stack.Peek(), stack.data[stack.Len()-3]) additionalGas.Set(stack.data[stack.Len()-3]) |