Skip to content

gh-146261: JIT: protect against function version changes - #146300

Merged
Fidget-Spinner merged 7 commits into
python:mainfrom
Fidget-Spinner:fix_func_version_changes
Apr 12, 2026
Merged

Fidget-Spinner merged 7 commits into
python:mainfrom
Fidget-Spinner:fix_func_version_changes

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Mar 22, 2026 •

Copy link
Copy Markdown
Member

This PR reverts the func_version symbol changes by using the fact that we have recorded values and _CHECK_FUNCTION_VERSION guards --- if we simply keep those around and not eliminate them, our function versions are guaranteed to be correct for all following _PUSH_FRAME if we invalidate dependencies properly in the function version changes.

Comment thread Objects/funcobject.c Resolved
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@Fidget-Spinner

Copy link
Copy Markdown
Member Author

@markshannon does this bugfix look okay to you? The reason we need this is that __code__ can be swapped out for functions. If you think it's okay, I can merge.

@Fidget-Spinner
Fidget-Spinner merged commit 6f7bb29 into python:main Apr 12, 2026
65 checks passed
prakashsellathurai added a commit to prakashsellathurai/cpython that referenced this pull request Apr 13, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants