You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Adjust that 2.2-2.6 "while" may not have COME_FROM
This commit is contained in:
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
Binary file not shown.
13
test/simple_source/bug26/08_distbug.py
Normal file
13
test/simple_source/bug26/08_distbug.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# From 2.3.7 dis.py. Bug ranged from 2.2 to 2.6.
|
||||||
|
# bug was in "while". uncompyle6 doesn't
|
||||||
|
# add in a COME_FROM after the while. Maybe it should?
|
||||||
|
|
||||||
|
def distb(tb=None):
|
||||||
|
"""Disassemble a traceback (default: last traceback)."""
|
||||||
|
if tb is None:
|
||||||
|
try:
|
||||||
|
tb = sys.last_traceback
|
||||||
|
except AttributeError:
|
||||||
|
raise RuntimeError, "no last traceback to disassemble"
|
||||||
|
while tb.tb_next: tb = tb.tb_next
|
||||||
|
disassemble(tb.tb_frame.f_code, tb.tb_lasti)
|
@@ -139,6 +139,7 @@ class Python26Parser(Python2Parser):
|
|||||||
|
|
||||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK _come_froms
|
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK _come_froms
|
||||||
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop bp_come_from
|
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop bp_come_from
|
||||||
|
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop POP_BLOCK
|
||||||
whilestmt ::= SETUP_LOOP testexpr returns POP_BLOCK COME_FROM
|
whilestmt ::= SETUP_LOOP testexpr returns POP_BLOCK COME_FROM
|
||||||
|
|
||||||
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK
|
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK
|
||||||
|
Reference in New Issue
Block a user