Commit 5c8c0ae0 authored by obscuren's avatar obscuren

Fixed size 0 bug

parent f9b0d1a8
...@@ -152,6 +152,10 @@ func (m *Memory) Get(offset, size int64) []byte { ...@@ -152,6 +152,10 @@ func (m *Memory) Get(offset, size int64) []byte {
} }
func (self *Memory) Geti(offset, size int64) (cpy []byte) { func (self *Memory) Geti(offset, size int64) (cpy []byte) {
if size == 0 {
return nil
}
if len(self.store) > int(offset) { if len(self.store) > int(offset) {
cpy = make([]byte, size) cpy = make([]byte, size)
copy(cpy, self.store[offset:offset+size]) copy(cpy, self.store[offset:offset+size])
......
...@@ -34,7 +34,7 @@ func NewDebugVm(env Environment) *DebugVm { ...@@ -34,7 +34,7 @@ func NewDebugVm(env Environment) *DebugVm {
lt = LogTyDiff lt = LogTyDiff
} }
return &DebugVm{env: env, logTy: lt, Recoverable: true} return &DebugVm{env: env, logTy: lt, Recoverable: false}
} }
func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) { func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment