-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
This code is problematic:
cpython/Objects/genericaliasobject.c
Lines 565 to 569 in dc03ce7
| PyObject *res = Py_GenericAlias(alias->origin, newargs); | |
| ((gaobject *)res)->starred = alias->starred; | |
| Py_DECREF(newargs); | |
| return res; |
Why? Py_GenericAlias can return NULL in different cases:
cpython/Objects/genericaliasobject.c
Lines 995 to 999 in dc03ce7
| return NULL; | |
| } | |
| if (!setup_ga(alias, origin, args)) { | |
| Py_DECREF(alias); | |
| return NULL; |
So, we need to check for NULL.
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error