summaryrefslogtreecommitdiffstats
path: root/Objects/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/call.c')
-rw-r--r--Objects/call.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/call.c b/Objects/call.c
index c663898..9672be0 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -175,13 +175,14 @@ PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *kwargs)
{
/* get vectorcallfunc as in _PyVectorcall_Function, but without
* the _Py_TPFLAGS_HAVE_VECTORCALL check */
+ vectorcallfunc func;
Py_ssize_t offset = Py_TYPE(callable)->tp_vectorcall_offset;
if (offset <= 0) {
PyErr_Format(PyExc_TypeError, "'%.200s' object does not support vectorcall",
Py_TYPE(callable)->tp_name);
return NULL;
}
- vectorcallfunc func = *(vectorcallfunc *)(((char *)callable) + offset);
+ memcpy(&func, (char *) callable + offset, sizeof(func));
if (func == NULL) {
PyErr_Format(PyExc_TypeError, "'%.200s' object does not support vectorcall",
Py_TYPE(callable)->tp_name);