Fixed mem error in vm. Fixed logs tests

This commit is contained in:
obscuren
2014-12-03 12:21:12 +01:00
parent f778922086
commit 3d9a4e7084
8 changed files with 59 additions and 24 deletions

View File

@ -147,9 +147,8 @@ func (m *Memory) Get(offset, size int64) []byte {
func (self *Memory) Geti(offset, size int64) (cpy []byte) {
if len(self.store) > int(offset) {
s := int64(math.Min(float64(len(self.store)), float64(offset+size)))
cpy = make([]byte, size)
copy(cpy, self.store[offset:offset+s])
copy(cpy, self.store[offset:offset+size])
return
}