From e8be65b2f3476cfb50fa228f23748b331f3f98f6 Mon Sep 17 00:00:00 2001 From: MrDakik Date: Tue, 27 Feb 2024 10:54:07 +0200 Subject: [PATCH 1/2] add support for `WITH_CLEANUP_START`,`WITH_CLEANUP_FINISH` --- ASTree.cpp | 4 ++++ tests/compiled/test_with.3.4.pyc | Bin 0 -> 480 bytes tests/compiled/test_with.3.5.pyc | Bin 0 -> 485 bytes 3 files changed, 4 insertions(+) create mode 100644 tests/compiled/test_with.3.4.pyc create mode 100644 tests/compiled/test_with.3.5.pyc diff --git a/ASTree.cpp b/ASTree.cpp index 0cc1314a3..e12e32e23 100644 --- a/ASTree.cpp +++ b/ASTree.cpp @@ -1885,6 +1885,7 @@ PycRef BuildFromCode(PycRef code, PycModule* mod) } break; case Pyc::WITH_CLEANUP: + case Pyc::WITH_CLEANUP_START: { // Stack top should be a None. Ignore it. PycRef none = stack.top(); @@ -1907,6 +1908,9 @@ PycRef BuildFromCode(PycRef code, PycModule* mod) } } break; + case Pyc::WITH_CLEANUP_FINISH: + /* Ignore this */ + break; case Pyc::SETUP_EXCEPT_A: { if (curblock->blktype() == ASTBlock::BLK_CONTAINER) { diff --git a/tests/compiled/test_with.3.4.pyc b/tests/compiled/test_with.3.4.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1142a853ec210a8d58ea5e8f9770d09021fabade GIT binary patch literal 480 zcmZXRzfQw25XQetQa5c={z#~AfJ7zKl?5RtHjogAmMl?)uOg79A#p`B_W^hX#KtRG zEQp3vbb0El&*n@WX%SbX$u2(AO-eJxF~I!KI_)cPmXkr$C)ZM z!UoT-I8*T?)zs|z+M8sYYCnobal%ogMb5=EQJO~D%XuiZZ*3B%tf|nR9ID|n^1wWG zWj+JNg^KQDb=}KK?eC8#a+>gg`2`d`W7-rr>$G83Kn?1cT^LVL!?Afm?swEQUd#Cc DKB-^1 literal 0 HcmV?d00001 diff --git a/tests/compiled/test_with.3.5.pyc b/tests/compiled/test_with.3.5.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e826aa718fcb34618d2df766d8aaede73676bdac GIT binary patch literal 485 zcmZXRJ5Iwu5QhI*I~(U=P!J*~pokQur9p^_4kR8@f*UJhC&I{ajO~b|&H-`-8Vato zqC;GPf{I;}0Fqa`vorJSo7qR#_nV*3Z@e#ncl;ZD|wD3#5QRV5kU} zSEE0rgTMhhcyO@-sG|3`dd=#A#Nq%fkxffzn|vH$SV0FCRl>IYZ4lJKb!0F2IZh&> z9GGMUJ}+Ui@ba+2f7mKUvb3sXr`=h~iT1*962%;bT4tQj<3iI!yBUv__NbRpVm(imYwk zyEI?zg7YGLii-O|y42qBbf)GppO~*eJ}|~7U+hxHtTr{MYj$ZoNeyB1lAKM{G+s-5 E14>0;l>h($ literal 0 HcmV?d00001 From ab80ec1d2c53b1488cde48eff9cb2a9fd040b75a Mon Sep 17 00:00:00 2001 From: MrDakik <68035827+TiZCrocodile@users.noreply.github.com> Date: Tue, 27 Feb 2024 19:20:50 +0200 Subject: [PATCH 2/2] moved compiled tests of with stmt to xfail --- tests/{compiled => xfail}/test_with.3.4.pyc | Bin tests/{compiled => xfail}/test_with.3.5.pyc | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/{compiled => xfail}/test_with.3.4.pyc (100%) rename tests/{compiled => xfail}/test_with.3.5.pyc (100%) diff --git a/tests/compiled/test_with.3.4.pyc b/tests/xfail/test_with.3.4.pyc similarity index 100% rename from tests/compiled/test_with.3.4.pyc rename to tests/xfail/test_with.3.4.pyc diff --git a/tests/compiled/test_with.3.5.pyc b/tests/xfail/test_with.3.5.pyc similarity index 100% rename from tests/compiled/test_with.3.5.pyc rename to tests/xfail/test_with.3.5.pyc