From b6413b6e6ee15ef365608948f5480b4af99b886a Mon Sep 17 00:00:00 2001 From: rocky Date: Thu, 7 Dec 2017 08:55:45 -0500 Subject: [PATCH] Skirt around control-flow problems... Tag some of the weaknesses if we can't address them now --- test/bytecode_3.5/03_while-if-break.pyc | Bin 310 -> 301 bytes test/simple_source/bug35/03_while-if-break.py | 2 +- uncompyle6/parsers/parse35.py | 8 ++++++++ uncompyle6/scanner.py | 3 +++ uncompyle6/scanners/scanner3.py | 6 +++--- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/test/bytecode_3.5/03_while-if-break.pyc b/test/bytecode_3.5/03_while-if-break.pyc index 5f971ce9bfeaec92881b02ec5bb66974c74d1201..0c5501e313350f2e1555040d885a5b23d0dd781f 100644 GIT binary patch delta 150 zcmdnSw3dlejF*>dx20y3!bDEja5Dx5h6+K38U}_UE{1>V3Qu8R2-alwd&vsa9kP-^lPQWNCqKX77Gp&b6Hus#Y2rE$RW?RO dMlNPfMm9!vrXr9^KTSq34OIhHI9Zxe8USad8ZQ6< delta 161 zcmZ3>w2g^VjF*?|lg9T5^@*IW2{sH23>D%GH4F?{3=GW-3`GJA0V#|OwTujf%nacb z(jb{4bA}p5h9U!o6eb47LRlCUp2ENotjX;6k`-u1h$dqcOG##KswPtuOHO`%!7av$ ql?+A96PJ20@=Sausm2UcRD>W{fZSUgHo5sJr8%i~An{@#W&i-!y&= 0 and end <= len(code)) diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index ced88098..4d87ac09 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -363,7 +363,7 @@ class Scanner3(Scanner): # FIXME: 0 isn't always correct target = self.get_target(inst.offset) if target <= inst.offset: - next_opname = self.opname[self.code[inst.offset+3]] + next_opname = self.insts[i+1].opname if (inst.offset in self.stmts and (self.version != 3.0 or (hasattr(inst, 'linestart'))) and (next_opname not in ('END_FINALLY', 'POP_BLOCK', @@ -948,12 +948,12 @@ class Scanner3(Scanner): self.not_continue.add(pre_rtarget) else: # For now, we'll only tag forward jump. - if self.version >= 3.6: + if self.version >= 3.5: if target > offset: self.fixed_jumps[offset] = target pass else: - # FIXME: This is probably a bug in < 3.6 and we should + # FIXME: This is probably a bug in < 3.5 and we should # instead use the above code. But until we smoke things # out we'll stick with it. if rtarget > offset: