◐ Shell
reader mode source ↗
Skip to content

bpo-36907: fix refcount bug in _PyStack_UnpackDict()#13381

Merged
encukou merged 2 commits into
python:masterfrom
jdemeyer:_PyStack_UnpackDict_refcount
May 22, 2019
Merged

bpo-36907: fix refcount bug in _PyStack_UnpackDict()#13381
encukou merged 2 commits into
python:masterfrom
jdemeyer:_PyStack_UnpackDict_refcount

Conversation

@jdemeyer

@jdemeyer jdemeyer commented May 17, 2019

Copy link
Copy Markdown
Contributor

@jdemeyer

Copy link
Copy Markdown
Contributor Author

I decided to increase the refcount in _PyStack_UnpackDict after all because that seemed the most natural place (and because I didn't want to contradict the "borrowed references" comments). If you disagree, it would also be possible to leave _PyStack_UnpackDict alone and increase the refcounts in the code calling _PyStack_UnpackDict.

This should probably be backported to 3.7 too.

@jdemeyer jdemeyer force-pushed the _PyStack_UnpackDict_refcount branch from 7f45962 to bdea0de Compare May 21, 2019 09:29
@jdemeyer jdemeyer force-pushed the _PyStack_UnpackDict_refcount branch from bdea0de to c047904 Compare May 21, 2019 09:44
@jdemeyer

Copy link
Copy Markdown
Contributor Author

Can this be merged please? That would be good for the PEP 590 implementation, which uses this function.

@encukou encukou 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.

Hide comment

I took the liberty to add a gc.collect() call.

@encukou

encukou commented May 22, 2019

Copy link
Copy Markdown
Member

#13493 is a backport to 3.7.

@jdemeyer jdemeyer deleted the _PyStack_UnpackDict_refcount branch May 22, 2019 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants