summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 20:55:17 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 20:55:17 (GMT)
commit4ba9001f5c9ecb144d1a63782a3fd5cd3646587a (patch)
treed7d323927b5b9aef3543f7b70225254f7f97accb /Tools/compiler
parent87797872a84ed8ca330fd98f8db63a9bef3e4287 (diff)
downloadcpython-4ba9001f5c9ecb144d1a63782a3fd5cd3646587a.zip
cpython-4ba9001f5c9ecb144d1a63782a3fd5cd3646587a.tar.gz
cpython-4ba9001f5c9ecb144d1a63782a3fd5cd3646587a.tar.bz2
Fix off-by-one errors in code to find depth of stack.
XXX The code is still widely inaccurate, but most (all?) of the time it's an overestimate.
Diffstat (limited to 'Tools/compiler')
-rw-r--r--Tools/compiler/compiler/pyassem.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/compiler/compiler/pyassem.py b/Tools/compiler/compiler/pyassem.py
index b2f91aa..413a954 100644
--- a/Tools/compiler/compiler/pyassem.py
+++ b/Tools/compiler/compiler/pyassem.py
@@ -764,11 +764,11 @@ class StackDepthTracker:
# UNPACK_SEQUENCE, BUILD_TUPLE,
# BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE
def UNPACK_SEQUENCE(self, count):
- return count
+ return count-1
def BUILD_TUPLE(self, count):
- return -count
+ return -count+1
def BUILD_LIST(self, count):
- return -count
+ return -count+1
def CALL_FUNCTION(self, argc):
hi, lo = divmod(argc, 256)
return lo + hi * 2