◐ Shell
clean mode source ↗

gh-132744: Check recursion limit in _PY_FRAME_GENERAL by Fidget-Spinner · Pull Request #132746 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@python-cla-bot

All commit authors signed the Contributor License Agreement.

CLA signed

@markshannon

Would it be better to add the _CHECK_STACK_SPACE micro-op to the CALL_PY_GENERAL and CALL_BOUND_METHOD_GENERAL macro instructions?

@Fidget-Spinner

Would it be better to add the _CHECK_STACK_SPACE micro-op to the CALL_PY_GENERAL and CALL_BOUND_METHOD_GENERAL macro instructions?

Done.

@Fidget-Spinner

Actually, those two instructions don't need to check stack space (they use the frame push that can fail, instead of the one that pushes without checks), they only need to check recursion remaining. So I split it into another uop to make things more efficient.

markshannon

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@miss-islington-app

@miss-islington-app

Sorry, @Fidget-Spinner and @markshannon, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ddac7ac59a7dfa4437562b6e705e64865c3b1e9a 3.13

Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request

Jul 12, 2025

@serhiy-storchaka

@bedevere-app