diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-02 18:52:56 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-02 18:52:56 +0800 |
commit | 64f35ba8d1f31d6821a0a1bf946c71396a996f30 (patch) | |
tree | 375a081536c7c0b329a3b0c2e812ff05f81dd64c /vm/vm_debug.go | |
parent | 616066a598933df7ef126186eb9c647094f665ca (diff) | |
parent | 99481a245adc2c4814ab6b38d94d63114f7bbb15 (diff) | |
download | dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.gz dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.zst dexon-64f35ba8d1f31d6821a0a1bf946c71396a996f30.zip |
merge errors fixed
Diffstat (limited to 'vm/vm_debug.go')
-rw-r--r-- | vm/vm_debug.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go index ce1f31b44..0a95953b0 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -163,7 +163,7 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { // Stack checks only case ISZERO, CALLDATALOAD, POP, JUMP, NOT: // 1 require(1) - case ADD, SUB, DIV, SDIV, MOD, SMOD, EXP, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE: // 2 + case ADD, SUB, DIV, SDIV, MOD, SMOD, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE: // 2 require(2) case ADDMOD, MULMOD: // 3 require(3) @@ -181,6 +181,16 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { reqGs.Set(GasLog) addStepGasUsage(new(big.Int).Mul(big.NewInt(int64(n)), GasLog)) addStepGasUsage(new(big.Int).Add(mSize, mStart)) + case EXP: + require(2) + + exp := new(big.Int).Set(stack.data[stack.Len()-2]) + nbytes := 0 + for exp.Cmp(ethutil.Big0) > 0 { + nbytes += 1 + exp.Rsh(exp, 8) + } + gas.Set(big.NewInt(int64(nbytes + 1))) // Gas only case STOP: reqGas.Set(ethutil.Big0) @@ -281,7 +291,6 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { addStepGasUsage(memGasUsage) - mem.Resize(newMemSize.Uint64()) } } @@ -295,6 +304,8 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { return nil, new(big.Int), OOG(reqGas, gas) } + mem.Resize(newMemSize.Uint64()) + switch op { // 0x20 range case ADD: |