Repository navigation
gh-155053: Fix GenericAlias crash on OOM - #155055
BHUVANSH855 wants to merge 7 commits into
Conversation
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @picnixz: please review the changes made to this pull request. |
|
@picnixz, gentle ping |
|
@picnixz, |
Summary
Fix a NULL dereference in
Objects/genericaliasobject.cwhentuple_extend()fails during
TypeVarTuplesubstitution under allocation failure.When
_PyTuple_Resize()fails, it clears its out-parameter, sosubargsbecomes
NULL. The error path insubs_tvars()must not callPy_DECREF(subargs)and should instead propagate theMemoryError.Also add a regression test covering the allocation-failure path using
_testcapi.set_nomemory()to ensure aMemoryErroris raised instead ofcrashing the interpreter.
Issue: gh-155053