Fix MAKE_FUNCTION default args for py 3.7 #539
Draft
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.
DRAFT: This is stacked on top of #538 as both include changes to the same opcode
Some changes for the handling of MAKE_FUNCTION operand & arguments in py3.6-3.12 that I discovered while make some fixes to decompile a py 3.11 app. I started on this before I noticed that #391 existed, but as this PR is stacked on top of #538 it works for py 3.0 & py 3.4 too.
MAKE_FUNCTION Python 3.4 Docs
MAKE_FUNCTION Python 3.7 Docs
Summary
Tests
The
test_functions_py3
for py 3.7 was in xfail.In the previous PR, I added a new test case and updated the tokenized version, to match this the
test_functions_py3.3.7.pyc
file incompiled
was re-built from the (previously updated) source ininput
.I used the
token_dump
andpymultic
scripts for this, with a slight modification to use-alpine
containers inpymultic
.New py3.6-12 Arg Defaults for MAKE_FUNCTION
With the current
master
,pycdc
produced this output for thex7d
test case on py3.7.However, this is the input
This is because the MAKE_FUNCTION code expects individual args on the stack, but they are now on the stack inside of 0-4 tuples & kwargs indicated by the operand flag.
Stacked on top of #538
Duplicates #391
Related Issues
#507 ?
#155 ?
#138
#448 The MAKE_FUNCTION part