diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-03 20:50:51 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-03 20:50:51 +0800 |
commit | 6095edac5843aa18e389ef2deaa49fe05b7fcfb9 (patch) | |
tree | 851b5616b2024248b6b9790199ef289e04725cbb /vm/vm_debug.go | |
parent | 64f35ba8d1f31d6821a0a1bf946c71396a996f30 (diff) | |
parent | 3d9a4e7084c33cb28a2265c0dd232a0ea3871c92 (diff) | |
download | go-tangerine-6095edac5843aa18e389ef2deaa49fe05b7fcfb9.tar.gz go-tangerine-6095edac5843aa18e389ef2deaa49fe05b7fcfb9.tar.zst go-tangerine-6095edac5843aa18e389ef2deaa49fe05b7fcfb9.zip |
merge
Diffstat (limited to 'vm/vm_debug.go')
-rw-r--r-- | vm/vm_debug.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go index 0a95953b0..31345c555 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -41,7 +41,7 @@ func NewDebugVm(env Environment) *DebugVm { lt = LogTyDiff } - return &DebugVm{env: env, logTy: lt, Recoverable: true} + return &DebugVm{env: env, logTy: lt, Recoverable: false} } //func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) { @@ -177,10 +177,13 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { n := int(op - LOG0) require(n + 2) - mSize, mStart := stack.Peekn() - reqGs.Set(GasLog) + gas.Set(GasLog) addStepGasUsage(new(big.Int).Mul(big.NewInt(int64(n)), GasLog)) - addStepGasUsage(new(big.Int).Add(mSize, mStart)) + + mSize, mStart := stack.Peekn() + addStepGasUsage(mSize) + + newMemSize = calcMemSize(mStart, mSize) case EXP: require(2) @@ -762,10 +765,10 @@ func (self *DebugVm) Run(call Options) (ret []byte, gas *big.Int, err error) { case LOG0, LOG1, LOG2, LOG3, LOG4: n := int(op - LOG0) topics := make([][]byte, n) - mStart, mSize := stack.Pop().Int64(), stack.Pop().Int64() + mSize, mStart := stack.Pop().Int64(), stack.Pop().Int64() data := mem.Geti(mStart, mSize) for i := 0; i < n; i++ { - topics[i] = stack.Pop().Bytes() + topics[i] = ethutil.LeftPadBytes(stack.Pop().Bytes(), 32) } //log := &state.Log{closure.Address(), topics, data} |