aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-16 00:47:45 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-16 00:47:45 +0100
commit98d8ae9eda1c8de9b538299da61e0668c77b15d5 (patch)
tree5c621460659521942d18d7bca5ccf6877a1adf35
parentfe98486c8baef779bdf7f2f73f6ffe7ee1281822 (diff)
...
-rw-r--r--stack.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/stack.go b/stack.go
index c116c5a..324e16d 100644
--- a/stack.go
+++ b/stack.go
@@ -17,9 +17,9 @@ func (s *stack) push(v uint16) {
}
func (s *stack) pop() uint16 {
- v := s.data[s.sp]
+ sp := s.sp
s.sp = (s.sp - 1) & (stackSize - 1)
- return v
+ return s.data[sp]
}
func (s *stack) peek() uint16 {