GH-128682: Stronger checking of PyStackRef_CLOSE and DEAD. (GH-128683)

This commit is contained in:
Mark Shannon 2025-01-13 12:37:48 +00:00 committed by GitHub
parent 6ff8f82f92
commit 517dc65ffc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 224 additions and 127 deletions

View file

@ -1739,6 +1739,18 @@ class TestGeneratedCases(unittest.TestCase):
with self.assertRaises(SyntaxError):
self.run_cases_test(input, "")
def test_kill_in_wrong_order(self):
input = """
inst(OP, (a, b -- c)) {
c = b;
PyStackRef_CLOSE(a);
PyStackRef_CLOSE(b);
}
"""
with self.assertRaises(SyntaxError):
self.run_cases_test(input, "")
class TestGeneratedAbstractCases(unittest.TestCase):
def setUp(self) -> None:
super().setUp()