FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-146092: Fix error handling in _BINARY_OP_ADD_UNICODE opcode by vstinner · Pull Request #146117 · python/cpython · GitHub

/ cpython Public

gh-146092: Fix error handling in _BINARY_OP_ADD_UNICODE opcode - #146117

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:eval_err
Mar 18, 2026
Merged

gh-146092: Fix error handling in _BINARY_OP_ADD_UNICODE opcode#146117
vstinner merged 2 commits into
python:mainfrom
vstinner:eval_err

Conversation

vstinner commented Mar 18, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Fix also error handling in _BINARY_OP_ADD_FLOAT,
_BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes. PyStackRef_FromPyObjectSteal() must not be called with a NULL pointer.

Fix also error handling in _BINARY_OP_ADD_FLOAT,
_BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes.
PyStackRef_FromPyObjectSteal() must not be called with a NULL
pointer.

Copy link
Copy Markdown
Member Author

I don't know well Python/bytecodes.c DSL, so I'm not sure if inputs are cleared properly on error.

Python 3.14 is also affected by the bug for _BINARY_OP_ADD_FLOAT, _BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes (_BINARY_OP_ADD_UNICODE is not affected), but it needs a different fix. Once this fix will be merged, I will write a different one for 3.14.

cc @Fidget-Spinner @corona10

Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks

Copy link
Copy Markdown
Member

I think you accidentally committed an out of date test_frozenmain?

Copy link
Copy Markdown
Member Author

I think you accidentally committed an out of date test_frozenmain?

I don't know what happened, but Programs/test_frozenmain.h was regenerated somehow. I fixed the issue.

Copy link
Copy Markdown
Member Author

Fix for the 3.14 branch: #146119.

vstinner merged commit 1e4ed93 into python:main Mar 18, 2026
73 checks passed
vstinner deleted the eval_err branch March 18, 2026 16:23

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1e4ed932109c4f8ee4f43bc3e6fdb7710a3606bd 3.14

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1e4ed932109c4f8ee4f43bc3e6fdb7710a3606bd 3.13

vstinner removed needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 18, 2026

Copy link
Copy Markdown
Member Author

@serhiy-storchaka added needs backport to 3.13 needs backport to 3.14 labels

As I wrote previously, the 3.14 branch needs a different fix. I wrote the PR gh-146119 for that.

Python 3.13 is not affected by the bug. PyStackRef_FromPyObjectSteal() doesn't exist in Python 3.13 (the function was added to Python 3.14).

Copy link
Copy Markdown
Member Author

PR merged. Thanks for your review @Fidget-Spinner.

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…ython#146117)

Fix also error handling in _BINARY_OP_ADD_FLOAT,
_BINARY_OP_SUBTRACT_FLOAT and _BINARY_OP_MULTIPLY_FLOAT opcodes.
PyStackRef_FromPyObjectSteal() must not be called with a NULL
pointer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL