aboutsummaryrefslogtreecommitdiffstats
path: root/vm/stack.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-02 17:30:27 +0800
committerobscuren <geffobscura@gmail.com>2015-01-02 17:30:27 +0800
commit0fb1bcd32192b8bf05a328b955a08da4cefe0180 (patch)
tree67460b927eb41b2876e8e6b7eb9dece494dbd088 /vm/stack.go
parent8da07e91e40c1d1bb43763b7e959ae92e5770af2 (diff)
parenta4dc12f12c7a06f5e28d5b1e760249875ef7a8c5 (diff)
downloaddexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.gz
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.bz2
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.lz
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.xz
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.zst
dexon-0fb1bcd32192b8bf05a328b955a08da4cefe0180.zip
Merge branch 'poc8' into docbranch
Diffstat (limited to 'vm/stack.go')
-rw-r--r--vm/stack.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm/stack.go b/vm/stack.go
index 6091479cb..b9eaa10cd 100644
--- a/vm/stack.go
+++ b/vm/stack.go
@@ -91,6 +91,12 @@ func (st *Stack) Get(amount *big.Int) []*big.Int {
return nil
}
+func (st *Stack) require(n int) {
+ if st.Len() < n {
+ panic(fmt.Sprintf("stack underflow (%d <=> %d)", st.Len(), n))
+ }
+}
+
func (st *Stack) Print() {
fmt.Println("### stack ###")
if len(st.data) > 0 {