aboutsummaryrefslogtreecommitdiffstats
path: root/vm/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/stack.go')
-rw-r--r--vm/stack.go4
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])