Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_testinternalcapi.optimize_cfg returns incorrect exception handler labels #115420

Closed
iritkatriel opened this issue Feb 13, 2024 · 0 comments · Fixed by #115425
Closed

_testinternalcapi.optimize_cfg returns incorrect exception handler labels #115420

iritkatriel opened this issue Feb 13, 2024 · 0 comments · Fixed by #115425
Labels
tests Tests in the Lib/test dir

Comments

@iritkatriel
Copy link
Member

iritkatriel commented Feb 13, 2024

    def test_except_handler_label(self):
        #
        insts = [
            ('SETUP_FINALLY', handler := self.Label(), 10),
            ('POP_BLOCK', 0, -1),
            ('RETURN_CONST', 1, 11),
            handler,
            ('RETURN_CONST', 2, 12),
        ]
        expected_insts = [
            ('SETUP_FINALLY', handler := self.Label(), 10),
            ('RETURN_CONST', 1, 11),
            handler,
            ('RETURN_CONST', 2, 12),
        ]
        self.cfg_optimization_test(insts, expected_insts, consts=list(range(5)))

This test fails because the code returns with SETUP_FINALLY uninitialized.

Linked PRs

@iritkatriel iritkatriel added the tests Tests in the Lib/test dir label Feb 13, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Feb 13, 2024
iritkatriel added a commit that referenced this issue Feb 15, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
1 participant