bpo-44553: Correct failure in tp_new for the union object #27008
Conversation
Before this PR:
after this PR:
|
I'm landing this as soon as the tests pass to unblock the buildbots |
if (result->args == NULL) { | ||
PyObject_GC_Del(result); |
pablogsal
Jul 3, 2021
Author
Member
@Fidget-Spinner For next occasions, the problem with this is that PyObject_GC_Del
cannot be called like that because it overrides a bunch of cleanups like the call to _Py_ForgetReference
and other possible handling.
Fidget-Spinner
Jul 4, 2021
Contributor
Sorry bout that. I'll keep that in mind in the future.
BTW, does this mean this should be changed as well? https://github.com/python/cpython/blob/main/Objects/genericaliasobject.c#L654
I'm confused as to why it doesn't break the buildbots, or maybe because none of our tests make the object setup fail so PyObject_GC_Del
is never called?
pablogsal
Jul 4, 2021
Author
Member
Yes, that has exactly the same problem. I assume is not being reaches by the tests and that's why we are not seeing corruption.
Thanks @pablogsal for the PR |
GH-27009 is a backport of this pull request to the 3.10 branch. |
…7008) (cherry picked from commit bc3961485639cc73de7c4c7eed1b56f3c74939bf) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
https://bugs.python.org/issue44553