Commit 9263848f authored by Jeremy Hylton's avatar Jeremy Hylton

Improve stack depth computation for try/except and try/finally

Add CONTINUE_LOOP to the list of unconditional transfers
parent 4bd4dddd
......@@ -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 = [
......
......@@ -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 = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment