aboutsummaryrefslogtreecommitdiff
path: root/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'stack.go')
-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 {