summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_frame.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_frame.py')
-rw-r--r--Lib/test/test_frame.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index ed413f1..40c734b 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -408,6 +408,15 @@ class TestCAPI(unittest.TestCase):
frame = next(gen)
self.assertIs(gen, _testcapi.frame_getgenerator(frame))
+ def test_frame_fback_api(self):
+ """Test that accessing `f_back` does not cause a segmentation fault on
+ a frame created with `PyFrame_New` (GH-99110)."""
+ def dummy():
+ pass
+
+ frame = _testcapi.frame_new(dummy.__code__, globals(), locals())
+ # The following line should not cause a segmentation fault.
+ self.assertIsNone(frame.f_back)
if __name__ == "__main__":
unittest.main()