diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-09 22:30:46 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-09 22:30:46 +0800 |
commit | 5c8c0ae04e83389e3b97c527c11c819f219e344d (patch) | |
tree | 578bc669f32be75e6ec93923c9cb92aec1587b3c | |
parent | f9b0d1a8e738a207e6101b27b667ea390def9f69 (diff) | |
download | go-tangerine-5c8c0ae04e83389e3b97c527c11c819f219e344d.tar.gz go-tangerine-5c8c0ae04e83389e3b97c527c11c819f219e344d.tar.zst go-tangerine-5c8c0ae04e83389e3b97c527c11c819f219e344d.zip |
Fixed size 0 bug
-rw-r--r-- | vm/stack.go | 4 | ||||
-rw-r--r-- | vm/vm_debug.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/vm/stack.go b/vm/stack.go index b9eaa10cd..f20470db3 100644 --- a/vm/stack.go +++ b/vm/stack.go @@ -152,6 +152,10 @@ func (m *Memory) Get(offset, size int64) []byte { } func (self *Memory) Geti(offset, size int64) (cpy []byte) { + if size == 0 { + return nil + } + if len(self.store) > int(offset) { cpy = make([]byte, size) copy(cpy, self.store[offset:offset+size]) diff --git a/vm/vm_debug.go b/vm/vm_debug.go index 92e4154e4..656487c9b 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -34,7 +34,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) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) { |