summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-07-28 09:53:33 (GMT)
committerGitHub <noreply@github.com>2023-07-28 09:53:33 (GMT)
commit0902afbae29ef88bf9d212a7e11f9f17b6cbdeb5 (patch)
treeeeada04f808fc41bfeb35fb8ac87dd3297c9a037 /Objects/classobject.c
parent3b1a4c18426c78a2fda0d59728bfe9eb92889722 (diff)
downloadcpython-0902afbae29ef88bf9d212a7e11f9f17b6cbdeb5.zip
cpython-0902afbae29ef88bf9d212a7e11f9f17b6cbdeb5.tar.gz
cpython-0902afbae29ef88bf9d212a7e11f9f17b6cbdeb5.tar.bz2
[3.12] GH-106895: Raise a `ValueError` when attempting to disable events that cannot be disabled. (GH-107337) (GH-107351)
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 71c4a4e..12dc276 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -48,6 +48,7 @@ method_vectorcall(PyObject *method, PyObject *const *args,
PyObject *self = PyMethod_GET_SELF(method);
PyObject *func = PyMethod_GET_FUNCTION(method);
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ assert(nargs == 0 || args[nargs-1]);
PyObject *result;
if (nargsf & PY_VECTORCALL_ARGUMENTS_OFFSET) {
@@ -56,6 +57,7 @@ method_vectorcall(PyObject *method, PyObject *const *args,
nargs += 1;
PyObject *tmp = newargs[0];
newargs[0] = self;
+ assert(newargs[nargs-1]);
result = _PyObject_VectorcallTstate(tstate, func, newargs,
nargs, kwnames);
newargs[0] = tmp;