Skip to content

Commit

Permalink
Merge pull request #460 from TiZCrocodile/support-for-`WITH_CLEANUP_S…
Browse files Browse the repository at this point in the history
…TART`,`WITH_CLEANUP_FINISH`

add support for `WITH_CLEANUP_START`,`WITH_CLEANUP_FINISH`
  • Loading branch information
zrax authored Feb 27, 2024
2 parents d361ec3 + ab80ec1 commit bb342a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
}
break;
case Pyc::WITH_CLEANUP:
case Pyc::WITH_CLEANUP_START:
{
// Stack top should be a None. Ignore it.
PycRef<ASTNode> none = stack.top();
Expand All @@ -1907,6 +1908,9 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
}
}
break;
case Pyc::WITH_CLEANUP_FINISH:
/* Ignore this */
break;
case Pyc::SETUP_EXCEPT_A:
{
if (curblock->blktype() == ASTBlock::BLK_CONTAINER) {
Expand Down
Binary file added tests/xfail/test_with.3.4.pyc
Binary file not shown.
Binary file added tests/xfail/test_with.3.5.pyc
Binary file not shown.

0 comments on commit bb342a9

Please sign in to comment.