summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-01-13 12:37:48 (GMT)
committerGitHub <noreply@github.com>2025-01-13 12:37:48 (GMT)
commit517dc65ffcea8413e1a60c4cb5d63e5fa39e7f72 (patch)
tree5f6fada4df4ed8df155189c6c5791ec6f9a798f3 /Lib
parent6ff8f82f92a8af363b2bdd8bbaba5845eef430fc (diff)
downloadcpython-517dc65ffcea8413e1a60c4cb5d63e5fa39e7f72.zip
cpython-517dc65ffcea8413e1a60c4cb5d63e5fa39e7f72.tar.gz
cpython-517dc65ffcea8413e1a60c4cb5d63e5fa39e7f72.tar.bz2
GH-128682: Stronger checking of `PyStackRef_CLOSE` and `DEAD`. (GH-128683)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_generated_cases.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py
index 75cbd8d..4a1c99e 100644
--- a/Lib/test/test_generated_cases.py
+++ b/Lib/test/test_generated_cases.py
@@ -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()