Commit graph

538 commits

Author SHA1 Message Date
Michael Hansen
b428976097
Merge pull request #599 from daiche330-png/wip/python311-exception-opcodes-20260405
Handle Python 3.11 exception opcodes in AST builder
2026-04-06 22:58:13 -07:00
daiche330-png
413fbd83c9 Support Python 3.11 exception table try/except flow 2026-04-06 09:30:16 +09:00
daiche330-png
0b1f7cf070 Handle Python 3.11 exception opcodes in AST builder 2026-04-05 22:13:27 +09:00
Michael Hansen
a05ddec0d8
Merge pull request #564 from whoami730/exceptions
Parse and display exception table
2025-08-30 10:02:14 -07:00
Sahil Jain
d8c6fdf711
Address comments 2025-08-30 20:01:32 +05:30
Michael Hansen
577720302e Add basic protection aginst circular references in pycdas and pycdc.
This fixes the last case of fuzzer errors detected by #572.
2025-08-28 16:42:03 -07:00
Michael Hansen
38799f5cfb Also check EOF in getBuffer() 2025-08-28 15:58:28 -07:00
Michael Hansen
0e7be40367 Add some extra guards against null dereference and empty std::stack pops
Fixes segfault cases of #572
2025-08-28 15:36:35 -07:00
Michael Hansen
ff0c1450b4 Abort immediately when attempting to read past end of stream.
No consumers of readByte() were actually checking for EOF, so they would
all keep re-reading the same byte over and over again, potentially until the
process runs out of memory (ref #572).
2025-08-28 15:14:55 -07:00
Sahil Jain
e8e10f1419
Parse exception table 2025-07-15 22:47:02 +05:30
Michael Hansen
a267bfb47f
Merge pull request #561 from whoami730/bug-fix
Fix bug in RAISE_VARARGS
2025-07-04 12:41:02 -07:00
Sahil Jain
8b0ea9450e
Fix RAISE_VARARGS bug 2025-07-04 19:16:04 +05:30
Michael Hansen
7d2039d24e
Merge pull request #557 from whoami730/new-opcodes
Support py 3.12 opcodes: part 2
2025-07-02 07:58:23 -07:00
Michael Hansen
e64ea4bdec
Merge branch 'master' into new-opcodes 2025-07-02 07:56:28 -07:00
Michael Hansen
4badfa6321
Merge pull request #555 from whoami730/master
Support py 3.12 opcodes: part 1
2025-07-02 07:51:36 -07:00
Sahil Jain
6e0089e01c
Update 2025-07-01 22:52:59 +05:30
Sahil Jain
3afcfbc6a7
Fix compilation error 2025-07-01 14:01:05 +05:30
Sahil Jain
aa292c7682
Add newlines 2025-07-01 09:27:07 +05:30
Sahil Jain
5fe61462a2
Support COPY opcde 2025-07-01 09:25:49 +05:30
Sahil Jain
ad5f39db56
Support SLICE opcodes 2025-07-01 09:24:53 +05:30
Sahil Jain
97ec04789d
Add JUMP_BACKWARD + CACHE comments 2025-07-01 09:22:57 +05:30
Sahil Jain
6dae4e801f
Remove COPY opcode 2025-07-01 09:22:57 +05:30
Sahil Jain
040732920b
Add comment 2025-07-01 09:22:57 +05:30
Sahil Jain
a93fd14672
Add new loop tests 2025-07-01 09:22:57 +05:30
Sahil Jain
a4a6a24f3e
Support END_FOR opcode 2025-07-01 09:22:56 +05:30
Michael Hansen
307e0b8fd7 Update to upload-artifact/v4 to fix CI 2025-06-30 19:21:38 -07:00
Michael Hansen
5e1c4037a9
Merge pull request #522 from samyk/report-invalid-opcode
show INVALID opcode properly if < 0
2024-10-13 09:54:24 -07:00
samy kamkar
bbc19885f4 show INVALID opcode properly if < 0 2024-10-12 13:45:16 -07:00
Michael Hansen
dc6ca4ae36 Remove additional specialized opcode that wasn't ordered with the others 2024-08-12 11:39:36 -07:00
Michael Hansen
19f8372358 Remove specialized opcodes.
They are used at runtime, and not written to .pyc / .pyo objects.
2024-08-12 11:24:07 -07:00
Michael Hansen
f37caa8f2a
Test runner refactor (#508)
* 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
2024-08-08 15:55:35 -07:00
Michael Hansen
b939aeb87c Update operand documentation for new opcodes and oparg changes.
Also extends the disassembly oparg decoding for new 3.13 additions.
2024-08-07 15:44:36 -07:00
Alex
75de28decc
Python 3.13 initial support (#497)
* Support for JUMP_BACKWARD

* Initial support for Python 3.13

* Remove opcode from another old PR, not needed in the current one

* Update bytes/python_3_13.cpp

Co-authored-by: Michael Hansen <zrax0111@gmail.com>

* Update bytecode_ops.inl

Co-authored-by: Michael Hansen <zrax0111@gmail.com>

* Update .gitignore

Co-authored-by: Michael Hansen <zrax0111@gmail.com>

* Update bytecode_ops.inl

---------

Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2024-08-07 15:39:40 -07:00
Michael Hansen
48d1bfa59f Fix a null dereference.
Fixes #486
2024-08-06 08:21:12 -07:00
Alex
cb32b581ee
Add one more missed flag: CO_ASYNC_GENERATOR (#505)
* Support for JUMP_BACKWARD

* Add missed flag CO_ASYNC_GENERATOR

* Revert "Support for JUMP_BACKWARD"

This reverts commit 81543ece8c.
2024-08-05 12:35:10 -07:00
Michael Hansen
c925dafcdf Also update the disassembly output to match the new flag values 2024-08-04 12:55:35 -07:00
Michael Hansen
0942dec653 Adjust CO_FUTURE_ flags to match Python 3.8 changes, and add some missing flags
Fixes #504
2024-08-04 12:55:28 -07:00
Michael Hansen
0b45b5fa07 Fix FORMAT_VALUE for values that have both a conversion and a format_spec.
Also output the conversion and flags in disassembly.
2024-08-01 13:28:43 -07:00
easyz
6ad3ceb67e
Add support for swap bytecode and simple WITH_EXCEPT_START bytecode support. (#488)
* 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 54dfe36629.

* Reapply "Resolve the warning about comparing size_t and int."

This reverts commit d21d1681ed.

* 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>
2024-06-23 11:59:30 -07:00
Michael Hansen
b9f3d145bb
Merge pull request #490 from Levak/levak/tests-parallel
Run tests in parallel or only some with a filter
2024-06-23 11:49:06 -07:00
Michael Hansen
462fc46424 Add JOBS parameter to GH workflows (currently default, but not guaranteed)
... and fix missing newline at EOF
2024-06-23 11:46:17 -07:00
Michael Hansen
d10c47af1e Add some tests for #492 2024-06-23 11:36:20 -07:00
Michael Hansen
ed49554b79
Merge pull request #492 from Levak/levak/fix_long_numeric
Fix Long Numeric Integer representation for Python 3
2024-06-23 11:35:10 -07:00
Levak Borok
2ae7f58a26 Fix Long Numeric Integer representation for Python 3
Before Python 3, long integers were input with an L suffix. Since
Python 3, all integers are 64-bit and do not need the L suffix.
2024-06-22 23:19:18 +02:00
Levak Borok
d8f955d692 Run tests in parallel or only some with a filter
`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.
2024-06-19 17:56:06 +02:00
Michael Hansen
513e03c883 Remove unnecessary template parameter in destructor. Fixes #487 2024-05-30 14:56:07 -07:00
Michael Hansen
6467c2cc52
Merge pull request #469 from greenozon/master
Fix for Centos6/7 compilation issues
2024-03-12 15:56:16 -07:00
Alex
8367a8e0ab Return back a fix for Centos6/7 compilation issues not related to shadow ones 2024-03-12 22:58:43 +02:00
Alex
fd80a359c7 Restore changes for shadow warnings... 2024-03-12 22:55:56 +02:00
Alex
ba91ff2de5 Revert shadow changes and add option -Wno-error=shadow to cmakefile 2024-03-12 22:40:50 +02:00