Make an attempt to pay for the gas prior to expanding the mem.
This commit is contained in:
@ -64,7 +64,7 @@ func (c *Closure) GetOp(x int) OpCode {
|
||||
}
|
||||
|
||||
func (c *Closure) GetByte(x int) byte {
|
||||
if x < len(c.Code) {
|
||||
if x > -1 && x < len(c.Code) {
|
||||
return c.Code[x]
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user