diff options
Diffstat (limited to 'ethvm/stack.go')
-rw-r--r-- | ethvm/stack.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ethvm/stack.go b/ethvm/stack.go index 82dd612c2..4ac023fb9 100644 --- a/ethvm/stack.go +++ b/ethvm/stack.go @@ -65,13 +65,13 @@ func (st *Stack) Peekn() (*big.Int, *big.Int) { } func (st *Stack) Swapn(n int) (*big.Int, *big.Int) { - st.data[n], st.data[0] = st.data[0], st.data[n] + st.data[len(st.data)-n], st.data[len(st.data)-1] = st.data[len(st.data)-1], st.data[len(st.data)-n] - return st.data[n], st.data[0] + return st.data[len(st.data)-n], st.data[len(st.data)-1] } func (st *Stack) Dupn(n int) *big.Int { - st.Push(st.data[n]) + st.Push(st.data[len(st.data)-n]) return st.Peek() } |