Only add forward-jumping COME_FROM in 3.6+

Is this a repeat commit?
This commit is contained in:
rocky
2019-05-14 06:28:29 -04:00
parent 44e1288e2f
commit 46acb74745
2 changed files with 2 additions and 5 deletions

View File

@@ -816,7 +816,8 @@ class Scanner3(Scanner):
# Fix up grammar so we don't need to do this.
# See cf_for_iter use in parser36.py
self.fixed_jumps[offset] = match[-1]
else:
elif target > offset:
# Right now we only add COME_FROMs in forward (not loop) jumps
self.fixed_jumps[offset] = target
return
# op == POP_JUMP_IF_TRUE