Skip to content

Remove duplicative Py_DECREF when handling _PyOptimizer_Optimize errors #123545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
savannahostrowski opened this issue Aug 31, 2024 · 0 comments
Closed
Assignees
Labels
3.13 bugs and security fixes 3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@savannahostrowski
Copy link
Member

savannahostrowski commented Aug 31, 2024

There are two places in the code where we call Py_DECREF twice when _PyOptimizer_Optimize returns -1. In both cases, we do so in the conditional block and then as part of the GOTO_UNWIND macro. This never really happens in practice, but it would be problematic if this error'd.

if (optimized < 0) {

if (optimized < 0) {

Linked PRs

@savannahostrowski savannahostrowski self-assigned this Aug 31, 2024
@brandtbucher brandtbucher added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.13 bugs and security fixes 3.14 bugs and security fixes labels Sep 3, 2024
savannahostrowski added a commit to savannahostrowski/cpython that referenced this issue Sep 6, 2024
…ptimizer_Optimize errors (pythonGH-123546)

(cherry picked from commit 1fbc118)

Co-authored-by: Savannah Ostrowski <[email protected]>
brandtbucher pushed a commit that referenced this issue Sep 6, 2024
…er_Optimize errors (GH-123759)

(cherry picked from commit 1fbc118)

Co-authored-by: Savannah Ostrowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants