mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
gh-96821: Fix undefined behaviour in _testcapimodule.c
(GH-96915)
* gh-96821: Assert for demonstrating undefined behaviour * Fix UB Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
parent
bbc24b2bd5
commit
cbdeda8ce7
2 changed files with 4 additions and 1 deletions
|
@ -4918,8 +4918,10 @@ meth_fastcall_keywords(PyObject* self, PyObject* const* args,
|
|||
if (pyargs == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
assert(args != NULL || nargs == 0);
|
||||
PyObject* const* args_offset = args == NULL ? NULL : args + nargs;
|
||||
PyObject *pykwargs = PyObject_Vectorcall((PyObject*)&PyDict_Type,
|
||||
args + nargs, 0, kwargs);
|
||||
args_offset, 0, kwargs);
|
||||
return Py_BuildValue("NNN", _null_to_none(self), pyargs, pykwargs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue