Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Add Add NULL check and fallback to ga_vectorcall
2. Add Null check to _Py_make_parameters when_PyTuple_Resize fails and parameter is null
11 changes: 9 additions & 2 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ _Py_make_parameters(PyObject *args)
len += needed;
if (_PyTuple_Resize(&parameters, len) < 0) {
Py_DECREF(subparams);
Py_DECREF(parameters);
Py_XDECREF(parameters);
Comment thread
prakashsellathurai marked this conversation as resolved.
Outdated
Py_XDECREF(tuple_args);
return NULL;
}
Expand Down Expand Up @@ -650,7 +650,14 @@ ga_vectorcall(PyObject *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames)
{
gaobject *alias = (gaobject *) self;
PyObject *obj = PyVectorcall_Function(alias->origin)(alias->origin, args, nargsf, kwnames);
vectorcallfunc origin_vectorcall = PyVectorcall_Function(alias->origin);
Comment thread
prakashsellathurai marked this conversation as resolved.
Outdated
PyObject *obj;
if (origin_vectorcall != NULL) {
obj = origin_vectorcall(alias->origin, args, nargsf, kwnames);
} else {
/* Fallback to generic call path*/
obj = PyObject_Vectorcall(alias->origin, args, nargsf, kwnames);
}
return set_orig_class(obj, self);
}

Expand Down
Loading