There was a problem hiding this comment.
This appears to be an unresolved merge conflict.
There was a problem hiding this comment.
Ooops... Sorry, I missed this one while manually backporting :( Fixed in b68f6d6
Thanks, Ned!
|
When you're done making the requested changes, leave the comment: |
The implementation of weakref.proxy's methods call back into the Python API using a borrowed references of the weakly referenced object (acquired via PyWeakref_GET_OBJECT). This API call may delete the last reference to the object (either directly or via GC), leaving a dangling pointer, which can be subsequently dereferenced. To fix this, claim a temporary ownership of the referenced object when calling the appropriate method. Some functions because at the moment they do not need to access the borrowed referent, but to protect against future changes to these functions, ownership need to be fixed in all potentially affected methods.. (cherry picked from commit 10cd00a) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
f82b200 to
b68f6d6
Compare
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @ned-deily: please review the changes made to this pull request. |
The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.
To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a)
Co-authored-by: Pablo Galindo Pablogsal@gmail.com
https://bugs.python.org/issue38395
Automerge-Triggered-By: @ned-deily