summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 22:27:14 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 22:27:14 (GMT)
commit9263848fa154ad2ba5288bf5adeda22d7c90f8a2 (patch)
tree96a0fcf0d67042f80c7bb089e3ceb294e6b95122 /Tools
parent4bd4dddd55787126857b76410cadd986df3ce7b7 (diff)
downloadcpython-9263848fa154ad2ba5288bf5adeda22d7c90f8a2.zip
cpython-9263848fa154ad2ba5288bf5adeda22d7c90f8a2.tar.gz
cpython-9263848fa154ad2ba5288bf5adeda22d7c90f8a2.tar.bz2
Improve stack depth computation for try/except and try/finally
Add CONTINUE_LOOP to the list of unconditional transfers
Diffstat (limited to 'Tools')
-rw-r--r--Tools/compiler/compiler/pyassem.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/compiler/compiler/pyassem.py b/Tools/compiler/compiler/pyassem.py
index 413a954..dc01656 100644
--- a/Tools/compiler/compiler/pyassem.py
+++ b/Tools/compiler/compiler/pyassem.py
@@ -267,7 +267,7 @@ class Block:
assert len(self.next) == 1, map(str, self.next)
_uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS',
- 'JUMP_ABSOLUTE', 'JUMP_FORWARD')
+ 'JUMP_ABSOLUTE', 'JUMP_FORWARD', 'CONTINUE_LOOP')
def pruneNext(self):
"""Remove bogus edge for unconditional transfers
@@ -753,6 +753,9 @@ class StackDepthTracker:
'IMPORT_STAR': -1,
'IMPORT_NAME': 0,
'IMPORT_FROM': 1,
+ # close enough...
+ 'SETUP_EXCEPT': 3,
+ 'SETUP_FINALLY': 3,
}
# use pattern match
patterns = [