You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Merge pull request #406 from tangboxuan/master
Fix offset of extended argument instruction
This commit is contained in:
@@ -163,8 +163,8 @@ def ifelsestmt(self, lhs, n, rule, tree, tokens, first, last):
|
||||
end_come_froms = end_come_froms[0]
|
||||
if not isinstance(end_come_froms, Token):
|
||||
if len(end_come_froms):
|
||||
return tokens[first].offset > end_come_froms[-1].attr
|
||||
elif tokens[first].offset > end_come_froms.attr:
|
||||
return tokens[first].off2int() > end_come_froms[-1].attr
|
||||
elif tokens[first].off2int() > end_come_froms.attr:
|
||||
return True
|
||||
|
||||
# FIXME: There is weirdness in the grammar we need to work around.
|
||||
@@ -173,7 +173,7 @@ def ifelsestmt(self, lhs, n, rule, tree, tokens, first, last):
|
||||
last_token = tree[-1]
|
||||
else:
|
||||
last_token = tokens[last]
|
||||
if last_token == "COME_FROM" and tokens[first].offset > last_token.attr:
|
||||
if last_token == "COME_FROM" and tokens[first].off2int() > last_token.attr:
|
||||
if self.version < (3, 0) and self.insts[self.offset2inst_index[last_token.attr]].opname != "SETUP_LOOP":
|
||||
return True
|
||||
|
||||
|
Reference in New Issue
Block a user