Handle Python 3.10 unsupported opcodes in AST builder#609
Open
Dere3046 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.