diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-13 18:45:11 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-13 18:45:11 +0800 |
commit | d078e9b8c92fb3bd5789a8e39c169b19864e0a04 (patch) | |
tree | 34ce9defddbd84364e681362eef072fa5e5dab97 /ethchain/stack.go | |
parent | b855e5f7df194c84651d7cc7ee32d307a2fa0a2e (diff) | |
download | go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.gz go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.bz2 go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.lz go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.xz go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.zst go-tangerine-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.zip |
Refactoring state transitioning
Diffstat (limited to 'ethchain/stack.go')
-rw-r--r-- | ethchain/stack.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ethchain/stack.go b/ethchain/stack.go index bf34e6ea9..37d1f84b9 100644 --- a/ethchain/stack.go +++ b/ethchain/stack.go @@ -111,6 +111,12 @@ func (m *Memory) Set(offset, size int64, value []byte) { copy(m.store[offset:offset+size], value) } +func (m *Memory) Resize(size uint64) { + if uint64(m.Len()) < size { + m.store = append(m.store, make([]byte, size-uint64(m.Len()))...) + } +} + func (m *Memory) Get(offset, size int64) []byte { return m.store[offset : offset+size] } |