Set sets offset + size to value
(offset, size uint64, value []byte)
| 36 | |
| 37 | // Set sets offset + size to value |
| 38 | func (m *Memory) Set(offset, size uint64, value []byte) { |
| 39 | // It's possible the offset is greater than 0 and size equals 0. This is because |
| 40 | // the calcMemSize (common.go) could potentially return 0 when size is zero (NO-OP) |
| 41 | if size > 0 { |
| 42 | // length of store may never be less than offset + size. |
| 43 | // The store should be resized PRIOR to setting the memory |
| 44 | if offset+size > uint64(len(m.store)) { |
| 45 | panic("invalid memory: store empty") |
| 46 | } |
| 47 | copy(m.store[offset:offset+size], value) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | // Set32 sets the 32 bytes starting at offset to the value of val, left-padded with zeroes to |
| 52 | // 32 bytes. |
no outgoing calls