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 /vm/stack.go | |
parent | f9b0d1a8e738a207e6101b27b667ea390def9f69 (diff) | |
download | dexon-5c8c0ae04e83389e3b97c527c11c819f219e344d.tar.gz dexon-5c8c0ae04e83389e3b97c527c11c819f219e344d.tar.zst dexon-5c8c0ae04e83389e3b97c527c11c819f219e344d.zip |
Fixed size 0 bug
Diffstat (limited to 'vm/stack.go')
-rw-r--r-- | vm/stack.go | 4 |
1 files changed, 4 insertions, 0 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]) |