You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Fix python 1.5 decompile bugs ...
add bytecode 1.5 tests from decompyle
This commit is contained in:
@@ -20,7 +20,7 @@ check:
|
||||
$(MAKE) check-$$PYTHON_VERSION
|
||||
|
||||
#: Run working tests from Python 2.6 or 2.7
|
||||
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-2.7-ok
|
||||
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-2.7-ok
|
||||
|
||||
#: Run working tests from Python 3.1
|
||||
check-3.1: check-bytecode
|
||||
@@ -50,6 +50,10 @@ check-3.6: check-bytecode
|
||||
check-disasm:
|
||||
$(PYTHON) dis-compare.py
|
||||
|
||||
#: Check deparsing bytecode 1.x only
|
||||
check-bytecode-1:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-1.5
|
||||
|
||||
#: Check deparsing bytecode 2.x only
|
||||
check-bytecode-2:
|
||||
$(PYTHON) test_pythonlib.py \
|
||||
@@ -65,7 +69,9 @@ check-bytecode-3:
|
||||
check-bytecode: check-bytecode-3
|
||||
$(PYTHON) test_pythonlib.py \
|
||||
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
|
||||
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
|
||||
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
|
||||
--bytecode-pypy2.7 --bytecode-1
|
||||
|
||||
|
||||
#: Check deparsing Python 2.1
|
||||
check-bytecode-2.1:
|
||||
|
BIN
test/bytecode_1.5/docstring.pyc
Normal file
BIN
test/bytecode_1.5/docstring.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/exceptions.pyc
Normal file
BIN
test/bytecode_1.5/exceptions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/exec.pyc
Normal file
BIN
test/bytecode_1.5/exec.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/expressions.pyc
Normal file
BIN
test/bytecode_1.5/expressions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/globals.pyc
Normal file
BIN
test/bytecode_1.5/globals.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/import.pyc
Normal file
BIN
test/bytecode_1.5/import.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/lambda.pyc
Normal file
BIN
test/bytecode_1.5/lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/misc.pyc
Normal file
BIN
test/bytecode_1.5/misc.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/nested_elif.pyc
Normal file
BIN
test/bytecode_1.5/nested_elif.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/print.pyc
Normal file
BIN
test/bytecode_1.5/print.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/slices.pyc
Normal file
BIN
test/bytecode_1.5/slices.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_class.pyc
Normal file
BIN
test/bytecode_1.5/test_class.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_class.pyo
Normal file
BIN
test/bytecode_1.5/test_class.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_del.pyc
Normal file
BIN
test/bytecode_1.5/test_del.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_del.pyo
Normal file
BIN
test/bytecode_1.5/test_del.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_docstring.pyc
Normal file
BIN
test/bytecode_1.5/test_docstring.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_docstring.pyo
Normal file
BIN
test/bytecode_1.5/test_docstring.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_empty.pyc
Normal file
BIN
test/bytecode_1.5/test_empty.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_empty.pyo
Normal file
BIN
test/bytecode_1.5/test_empty.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_exceptions.pyc
Normal file
BIN
test/bytecode_1.5/test_exceptions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_exceptions.pyo
Normal file
BIN
test/bytecode_1.5/test_exceptions.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_exec.pyc
Normal file
BIN
test/bytecode_1.5/test_exec.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_exec.pyo
Normal file
BIN
test/bytecode_1.5/test_exec.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_expressions.pyc
Normal file
BIN
test/bytecode_1.5/test_expressions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_expressions.pyo
Normal file
BIN
test/bytecode_1.5/test_expressions.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_functions.pyc
Normal file
BIN
test/bytecode_1.5/test_functions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_functions.pyo
Normal file
BIN
test/bytecode_1.5/test_functions.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_global.pyc
Normal file
BIN
test/bytecode_1.5/test_global.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_global.pyo
Normal file
BIN
test/bytecode_1.5/test_global.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_globals.pyc
Normal file
BIN
test/bytecode_1.5/test_globals.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_globals.pyo
Normal file
BIN
test/bytecode_1.5/test_globals.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_import.pyc
Normal file
BIN
test/bytecode_1.5/test_import.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_import.pyo
Normal file
BIN
test/bytecode_1.5/test_import.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_integers.pyc
Normal file
BIN
test/bytecode_1.5/test_integers.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_integers.pyo
Normal file
BIN
test/bytecode_1.5/test_integers.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_lambda.pyc
Normal file
BIN
test/bytecode_1.5/test_lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_lambda.pyo
Normal file
BIN
test/bytecode_1.5/test_lambda.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_loops.pyc
Normal file
BIN
test/bytecode_1.5/test_loops.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_loops.pyo
Normal file
BIN
test/bytecode_1.5/test_loops.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_misc.pyc
Normal file
BIN
test/bytecode_1.5/test_misc.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_misc.pyo
Normal file
BIN
test/bytecode_1.5/test_misc.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_nested_elif.pyc
Normal file
BIN
test/bytecode_1.5/test_nested_elif.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_nested_elif.pyo
Normal file
BIN
test/bytecode_1.5/test_nested_elif.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_prettyprint.pyc
Normal file
BIN
test/bytecode_1.5/test_prettyprint.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_prettyprint.pyo
Normal file
BIN
test/bytecode_1.5/test_prettyprint.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_print.pyc
Normal file
BIN
test/bytecode_1.5/test_print.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_print.pyo
Normal file
BIN
test/bytecode_1.5/test_print.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_single_stmt.pyc
Normal file
BIN
test/bytecode_1.5/test_single_stmt.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_single_stmt.pyo
Normal file
BIN
test/bytecode_1.5/test_single_stmt.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_slices.pyc
Normal file
BIN
test/bytecode_1.5/test_slices.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_slices.pyo
Normal file
BIN
test/bytecode_1.5/test_slices.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_tuple_params.pyc
Normal file
BIN
test/bytecode_1.5/test_tuple_params.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_tuple_params.pyo
Normal file
BIN
test/bytecode_1.5/test_tuple_params.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_tuples.pyc
Normal file
BIN
test/bytecode_1.5/test_tuples.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/test_tuples.pyo
Normal file
BIN
test/bytecode_1.5/test_tuples.pyo
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/tuple_params.pyc
Normal file
BIN
test/bytecode_1.5/tuple_params.pyc
Normal file
Binary file not shown.
@@ -78,7 +78,8 @@ for vers in (2.7, 3.4, 3.5, 3.6):
|
||||
test_options[key] = (os.path.join(src_dir, pythonlib), PYOC, key, vers)
|
||||
pass
|
||||
|
||||
for vers in (2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7,
|
||||
for vers in (1.5,
|
||||
2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7,
|
||||
3.1, 3.2, 3.3,
|
||||
3.4, 3.5, 3.6, 'pypy3.2', 'pypy2.7'):
|
||||
bytecode = "bytecode_%s" % vers
|
||||
|
@@ -224,11 +224,7 @@ class Scanner26(scan.Scanner2):
|
||||
elif op in self.opc.hasjabs:
|
||||
pattr = repr(oparg)
|
||||
elif op in self.opc.haslocal:
|
||||
if self.version >= 2.0:
|
||||
pattr = varnames[oparg]
|
||||
elif self.version < 2.0:
|
||||
if oparg < len(names):
|
||||
pattr = names[oparg]
|
||||
pattr = varnames[oparg]
|
||||
elif op in self.opc.hascompare:
|
||||
pattr = self.opc.cmp_op[oparg]
|
||||
elif op in self.opc.hasfree:
|
||||
|
Reference in New Issue
Block a user