From 8b0ea9450e8567def52c527df3c1bdfa2489fdbb Mon Sep 17 00:00:00 2001 From: Sahil Jain Date: Fri, 4 Jul 2025 19:12:55 +0530 Subject: [PATCH] Fix RAISE_VARARGS bug --- ASTree.cpp | 2 -- tests/compiled/test_raise_varargs.3.12.pyc | Bin 0 -> 630 bytes tests/input/test_raise_varargs.py | 7 +++++++ tests/tokenized/test_raise_varargs.txt | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/compiled/test_raise_varargs.3.12.pyc create mode 100644 tests/input/test_raise_varargs.py create mode 100644 tests/tokenized/test_raise_varargs.txt diff --git a/ASTree.cpp b/ASTree.cpp index e6e6c7e..3542921 100644 --- a/ASTree.cpp +++ b/ASTree.cpp @@ -1820,8 +1820,6 @@ PycRef BuildFromCode(PycRef code, PycModule* mod) blocks.pop(); curblock = blocks.top(); curblock->append(prev.cast()); - - bc_next(source, mod, opcode, operand, pos); } } break; diff --git a/tests/compiled/test_raise_varargs.3.12.pyc b/tests/compiled/test_raise_varargs.3.12.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f5a2c94fa303edd609cb81ba703a409cff0baa6 GIT binary patch literal 630 zcmZ`#F>ezw7`1cPv?L@dWuX!hMq=QGUPX%9rG+BIkOc`LF{DV*Q3+mIE|0KiA8F(|WK*z}qo}!?bZ9bIAfGI;F(i$2@v{5|i zklTVABiIs4D36kW7zqNwwIQ-iR%%NvZpe;QREOt2gen)A-LEJ8)Z{su2$porHtD6{ zX)$p3Qek*sFqd$bw57@eNSycATqdE#>lW7o-+ExSrDu^y*(0T-vPBpxjg2j)Nk59a z0k*iM-NTVTx59AQFm3cQcinT|R1w##IfzuGIy&qRZPi^)H;ruOQ>zMi-4p9gD6i44 z+0xrPdxHb~COdet`|7NEZM4`pt!|Cxw$92|K5V?(IJ$bIKgVBgerg}%kKL0SwUfo# z@q^Ry>d0RmLk0>8>JohN +def bytes_to_words ( b ) : + +'Convert a byte string (little-endian) to a list of 32-bit words.' +if len ( b ) % 4 != 0 : + +raise ValueError ( 'Input bytes length must be a multiple of 4 for word conversion.' ) + +return struct . unpack ( '<' + 'I' * ( len ( b ) // 4 ) , b )