* Port test runner script to Python.
This allows us to keep the test output in sorted order while still running the
tests in parallel. It also now defaults to using the number of available CPU
threads for parallel execution, rather than the previously hard-coded default.
* Also port decompyle_test.sh script to python within run_tests.py
* Fix cmake check target for multi-config generators.
Adds testing of release builds on both MSVC and GCC.
* Fix diff comparisons on Windows
* Ubuntu runners don't have ninja by default
* Modify .gitignore
* Added support for SWAP and WITH_EXCEPT_START, WITH_EXCEPT_START is simply added on top of SETUP_WITH_A so that it works properly.
* Resolve the warning about comparing size_t and int.
* Revert "Resolve the warning about comparing size_t and int."
This reverts commit 54dfe36629855ca557277572d307dacaf6a64fe9.
* Reapply "Resolve the warning about comparing size_t and int."
This reverts commit d21d1681ed6496856ea65151e5fd798f0a718416.
* Modify decompyle_test.sh
* Modify .gitignore
* Fix the logic error by placing the assignment inside the tuple
* Re-adding test files
* Fixing redundant brackets
* Add support for swap bytecode and simple WITH_EXCEPT_START bytecode support.
* Clean up some formatting issues
---------
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
`make check JOBS=4` will spawn 4 workers and spread the tests among them.
`make check FILTER=try` will only run tests that contain `try` in their name.
The opcode itself is exactly the same as `LOAD_DEREF`
1) The problem is when the class is a closure (e.g. defined inside a function body) then there is a `BUILD_TUPLE` after the `LOAD_BUILD_CLASS` which makes problems.
2) There is another problem which makes the `code->name()` of the class to be part of the function locals. (e.g. `func.<locals>.my_class` instead of `my_class`) which makes the check `srcString->isEqual(code->name().cast<PycObject>())` be invalid.
* fix #396 Unsupported Node type: 27
* Add test file
* Modify a little comment
* Modify the test pyc file name
* Delete redundant pyc files
* retest
* Add newline at EOF
---------
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
* Apparently should be enough ?
* Add `GEN_START` test
* Add `GEN_START` test compiled
* Add `GEN_START` test tokenized
* Smaller test since only POP is needed.
* Smaller test since only POP is needed.
* Smaller test since only POP is needed.
* dos2unix
* Add `PUSH_NULL`, `PRECALL_A`, `CALL_A` support
* feat: @zrax
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
* Good suggested change to make the code shorter
* Add `PUSH_NULL`, `PRECALL`, `CALL` test tokenized
* Add `PUSH_NULL`, `PRECALL`, `CALL` test
* Add `PUSH_NULL`, `PRECALL`, `CALL` test compiled
* Delete push_null-precall-call.3.11.pyc
* Delete push_null-precall-call.py
* Delete push_null-precall-call.txt
* Update README.markdown
Blank commit to re-run the tests.
* Join all no-ops/"fake"-ops together
* Update ASTree.cpp
https://github.com/zrax/pycdc/pull/324#issuecomment-1449049283
* Add compiled test for #324
---------
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
We know when we have begun a chained assignment when we process a DUP_TOP with non-null on the stack. Push a NODE_CHAINSTORE onto the stack when this happens, and keep it 'floating' on top of the stack for all STORE_X operations until the stack is empty.
To support versions of Python <= 2.5 which use DUP_TOP in more places, I modified ROT_TWO, ROT_THREE and ROT_FOUR to get rid of NODE_CHAINSTORE on the stack if it is present.
Instead of ignoring boilerplate when decompiling `async for`, build the loop semantically by deconstructing the BLK_WHILE -> BLK_CONTAINER -> BLK_TRY that python generates when compiling an `async for` (see https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for).
When reading GET_AITER, convert the BLK_WHILE into a BLK_ASYNCFOR in the same way as a `for` loop.
Ignore GET_ANEXT.
Use END_FINALLY as the trigger to finish building the BLK_ASYNCFOR:
-> Extract the loop variable from the contents of the BLK_TRY.
-> Throw away the BLK_TRY and BLK_CONTAINER, leave the BLK_ASYNCFOR on top of the stack.