Skip to content

Commit ebccd1d

Browse files
authored
[3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746) (GH-138032)
1 parent 8f22802 commit ebccd1d

File tree

9 files changed

+164
-122
lines changed

9 files changed

+164
-122
lines changed

Include/internal/pycore_opcode_metadata.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 118 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_metadata.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_opcache.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,13 @@ def count_args(self, *args):
537537
MyClass.__init__.__code__ = count_args.__code__
538538
instantiate()
539539

540+
def test_recursion_check_for_general_calls(self):
541+
def test(default=None):
542+
return test()
543+
544+
with self.assertRaises(RecursionError):
545+
test()
546+
540547

541548
@threading_helper.requires_working_threading()
542549
@requires_specialization
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Certain calls now check for runaway recursion and respect the system recursion limit.

0 commit comments

Comments
 (0)