Skip to content

Handle Python 3.10 unsupported opcodes in AST builder#609

Open
Dere3046 wants to merge 1 commit into
zrax:masterfrom
Dere3046:py310-opcodes
Open

Handle Python 3.10 unsupported opcodes in AST builder#609
Dere3046 wants to merge 1 commit into
zrax:masterfrom
Dere3046:py310-opcodes

Conversation

@Dere3046

Copy link
Copy Markdown

Adds handler cases for 7 Python 3.10 opcodes that were previously
unhandled, preventing pycdc from decompiling any module containing
*args/**kwargs calls, extended unpack, dict merge, assert, or
try/except exception matching.

CALL_FUNCTION_EX produces ASTCall with setVar/setKW for
*args/**kwargs
UNPACK_EX uses the existing unpack mechanism
like UNPACK_SEQUENCE
DICT_MERGE stack balancing for {**d} in dict displays
DICT_UPDATE stack balancing for dict accumulator updates
LOAD_ASSERTION_ERROR stack balancing for assert statements
LIST_TO_TUPLE stack balancing for list-to-tuple conversion
JUMP_IF_NOT_EXC_MATCH stack balancing for except type matching

MAP_ADD and SET_ADD intentionally not handled — their comprehension
AST reconstruction triggers block management issues when used with
conditional comprehension expressions.

4 new tests added: test_call_starargs_310, test_unpack_ex_310,
test_assert_310, test_dict_merge_310. All 84 upstream tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant