Add Python 3.11/3.12 opcode handlers to reduce decompilation failures#602
Open
gustavomfc wants to merge 1 commit into
Open
Add Python 3.11/3.12 opcode handlers to reduce decompilation failures#602gustavomfc wants to merge 1 commit into
gustavomfc wants to merge 1 commit into
Conversation
No-op prologue/bookkeeping opcodes:
- MAKE_CELL_A: closure cell initialization (Python 3.11+)
- COPY_FREE_VARS_A: copies free vars into frame at function entry (3.11+)
- RETURN_GENERATOR: marks a function as a generator (3.12)
Stack/call opcodes:
- YIELD_VALUE_A: generator yield with stack-depth operand (3.12)
- CALL_FUNCTION_EX_A / INSTRUMENTED_CALL_FUNCTION_EX_A: func(*args, **kwargs)
- LOAD_SUPER_ATTR_A: super().attr access (3.12 specialization)
- LOAD_FROM_DICT_OR_DEREF_A: closure variable load (3.12)
Comprehension opcodes:
- SET_ADD_A: set comprehension element append
- MAP_ADD_A: dict comprehension key/value append
- DICT_UPDATE_A: in-place dict merge (like SET_UPDATE_A for dicts)
Other opcodes:
- LOAD_ASSERTION_ERROR: pushes AssertionError class (used in assert stmts)
- DICT_MERGE_A: merges **kwargs mapping into accumulator dict
- CALL_INTRINSIC_1_A: Python-internal intrinsic functions (pass-through)
- POP_JUMP_IF_NONE_A / POP_JUMP_IF_NOT_NONE_A: None-checking conditional jumps
- LOAD_FAST_CHECK_A / LOAD_FAST_AND_CLEAR_A: variants of LOAD_FAST
Bug fixes:
- Restore accidentally-removed 'case Pyc::LOAD_ATTR_A:' label that was
clobbered when inserting the DICT_MERGE_A handler
- Handle NODE_TUPLE (and other unexpected node types) inside f-string
(NODE_JOINEDSTR) value lists by wrapping them in { } instead of
emitting 'Unsupported node type' and marking cleanBuild=false
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
No-op prologue/bookkeeping opcodes:
Stack/call opcodes:
Comprehension opcodes:
Other opcodes:
Bug fixes: