You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
COME_FROM for 3.x POP_EXCEPT, DRY with op_name() ...
Start adding COME_FROMs for POP_EXCEPT in preparation for getting tryelse blocks correct. Simpler opname access functions: - self.op_name(op) is self.opc.opname[op] - self.op_name_from_offset(offset) is self.opc.opname[self.code[offset]] verify.py: not all offsets are ints
This commit is contained in:
@@ -331,18 +331,22 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2,
|
||||
raise CmpErrorCode(name, tokens1[i1].offset, tokens1[i1],
|
||||
tokens2[i2], tokens1, tokens2)
|
||||
elif tokens1[i1].type in JUMP_OPs and tokens1[i1].pattr != tokens2[i2].pattr:
|
||||
dest1 = int(tokens1[i1].pattr)
|
||||
dest2 = int(tokens2[i2].pattr)
|
||||
if tokens1[i1].type == 'JUMP_BACK':
|
||||
dest1 = int(tokens1[i1].pattr)
|
||||
dest2 = int(tokens2[i2].pattr)
|
||||
if offset_map[dest1] != dest2:
|
||||
raise CmpErrorCode(name, tokens1[i1].offset, tokens1[i1],
|
||||
tokens2[i2], tokens1, tokens2)
|
||||
else:
|
||||
# import pdb; pdb.set_trace()
|
||||
if dest1 in check_jumps:
|
||||
check_jumps[dest1].append((i1, i2, dest2))
|
||||
else:
|
||||
check_jumps[dest1] = [(i1, i2, dest2)]
|
||||
try:
|
||||
dest1 = int(tokens1[i1].pattr)
|
||||
if dest1 in check_jumps:
|
||||
check_jumps[dest1].append((i1, i2, dest2))
|
||||
else:
|
||||
check_jumps[dest1] = [(i1, i2, dest2)]
|
||||
except:
|
||||
pass
|
||||
|
||||
i1 += 1
|
||||
i2 += 1
|
||||
|
Reference in New Issue
Block a user