Make an attempt to pay for the gas prior to expanding the mem.

This commit is contained in:
obscuren
2014-12-01 20:49:56 +01:00
parent beb7d35c40
commit a22056db59
3 changed files with 7 additions and 3 deletions

View File

@ -277,7 +277,6 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
addStepGasUsage(memGasUsage)
mem.Resize(newMemSize.Uint64())
}
}
@ -295,6 +294,8 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
return closure.Return(nil), OOG(gas, tmp)
}
mem.Resize(newMemSize.Uint64())
switch op {
// 0x20 range
case ADD: