gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c#121136
Merged
gaogaotiantian merged 1 commit intopython:mainfrom Jun 28, 2024
Legoclones:pickle-additems-decref
Merged
gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c#121136gaogaotiantian merged 1 commit intopython:mainfrom Legoclones:pickle-additems-decref
gaogaotiantian merged 1 commit intopython:mainfrom
Legoclones:pickle-additems-decref
Conversation
PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so 2x calls to this function are added
gaogaotiantian
approved these changes
Jun 28, 2024
Member
gaogaotiantian
left a comment
There was a problem hiding this comment.
No user observable changes so I skipped the news.
|
Thanks @Legoclones for the PR, and @gaogaotiantian for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jun 28, 2024
…pickle.c (pythonGH-121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added (cherry picked from commit 92893fd) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jun 28, 2024
…pickle.c (pythonGH-121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added (cherry picked from commit 92893fd) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
|
GH-121139 is a backport of this pull request to the 3.13 branch. |
|
GH-121140 is a backport of this pull request to the 3.12 branch. |
Member
|
Thank you for fixing this! |
gaogaotiantian
pushed a commit
that referenced
this pull request
Jun 28, 2024
…_pickle.c (GH-121136) (#121139) gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added (cherry picked from commit 92893fd) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
gaogaotiantian
pushed a commit
that referenced
this pull request
Jun 28, 2024
…_pickle.c (GH-121136) (#121140) gh-121137: Add missing Py_DECREF calls for ADDITEMS opcode of _pickle.c (GH-121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added (cherry picked from commit 92893fd) Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this pull request
Jun 30, 2024
…pickle.c (python#121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this pull request
Jul 11, 2024
…pickle.c (python#121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
estyxx
pushed a commit
to estyxx/cpython
that referenced
this pull request
Jul 17, 2024
…pickle.c (python#121136) PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so Py_DECREF calls to this referece are added
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


In the
load_additemsfunction ofModules/_pickle.c(which handles theADDITEMSopcode), PyObject_GetAttr is called and returnsadd_funcon line 6660. PyObject_GetAttr returns a new reference, but this reference is never decremented using Py_DECREF, so 2x calls to this function are added (compare todo_appendfunction in the same file).