aboutsummaryrefslogtreecommitdiffstats
path: root/ethvm/stack.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-16 04:11:05 +0800
committerobscuren <geffobscura@gmail.com>2014-09-16 04:11:05 +0800
commit399256b38403f2e95312250d49fca3cada8956b8 (patch)
tree25ee8bb6334377fb18a39463c8bd85ea7878f641 /ethvm/stack.go
parent33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (diff)
downloadgo-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.gz
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.bz2
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.lz
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.xz
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.zst
go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.zip
VM execution fixes
Refactoring caused executing issues
Diffstat (limited to 'ethvm/stack.go')
-rw-r--r--ethvm/stack.go6
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()
}