Commit 5492c429 authored by Stefan Behnel's avatar Stefan Behnel

Avoid a call to PyTuple_GET_ITEM() to get the item array pointer if...

Avoid a call to PyTuple_GET_ITEM() to get the item array pointer if CYTHON_ASSUME_SAFE_MACROS is disabled.
See https://github.com/cython/cython/issues/3701
parent 8f53112a
...@@ -652,7 +652,13 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P ...@@ -652,7 +652,13 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P
// CPython would normally use vectorcall directly instead of tp_call. // CPython would normally use vectorcall directly instead of tp_call.
__pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
if (vc) { if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), PyTuple_GET_SIZE(args), kw); return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), PyTuple_GET_SIZE(args), kw);
#else
// avoid unused function warning
(void) &__Pyx_PyVectorcall_FastCallDict;
return PyVectorcall_Call(func, args, kw);
#endif
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment