@@ -312,7 +312,7 @@ _PyCFunction_FastCallKeywords(PyObject *func_obj, PyObject **args,
312
312
func = (PyCFunctionObject * )func_obj ;
313
313
meth = PyCFunction_GET_FUNCTION (func );
314
314
self = PyCFunction_GET_SELF (func );
315
- flags = PyCFunction_GET_FLAGS (func ) & ~(METH_CLASS | METH_STATIC | METH_COEXIST );
315
+ flags = PyCFunction_GET_FLAGS (func ) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS );
316
316
317
317
switch (flags )
318
318
{
@@ -328,6 +328,7 @@ _PyCFunction_FastCallKeywords(PyObject *func_obj, PyObject **args,
328
328
goto no_keyword_error ;
329
329
}
330
330
331
+ STACKLESS_PROMOTE_FLAG (PyCFunction_GET_FLAGS (func ) & METH_STACKLESS );
331
332
result = (* meth ) (self , NULL );
332
333
break ;
333
334
@@ -343,11 +344,13 @@ _PyCFunction_FastCallKeywords(PyObject *func_obj, PyObject **args,
343
344
goto no_keyword_error ;
344
345
}
345
346
347
+ STACKLESS_PROMOTE_FLAG (PyCFunction_GET_FLAGS (func ) & METH_STACKLESS );
346
348
result = (* meth ) (self , args [0 ]);
347
349
break ;
348
350
349
351
case METH_FASTCALL :
350
352
/* Fast-path: avoid temporary dict to pass keyword arguments */
353
+ STACKLESS_PROMOTE_FLAG (PyCFunction_GET_FLAGS (func ) & METH_STACKLESS );
351
354
result = ((_PyCFunctionFast )meth ) (self , args , nargs , kwnames );
352
355
break ;
353
356
@@ -381,10 +384,12 @@ _PyCFunction_FastCallKeywords(PyObject *func_obj, PyObject **args,
381
384
kwdict = NULL ;
382
385
}
383
386
387
+ STACKLESS_PROMOTE_FLAG (PyCFunction_GET_FLAGS (func ) & METH_STACKLESS );
384
388
result = (* (PyCFunctionWithKeywords )meth ) (self , argtuple , kwdict );
385
389
Py_XDECREF (kwdict );
386
390
}
387
391
else {
392
+ STACKLESS_PROMOTE_FLAG (PyCFunction_GET_FLAGS (func ) & METH_STACKLESS );
388
393
result = (* meth ) (self , argtuple );
389
394
}
390
395
Py_DECREF (argtuple );
@@ -397,6 +402,7 @@ _PyCFunction_FastCallKeywords(PyObject *func_obj, PyObject **args,
397
402
"METH_OLDARGS is no longer supported!" );
398
403
return NULL ;
399
404
}
405
+ STACKLESS_ASSERT ();
400
406
401
407
result = _Py_CheckFunctionResult (func_obj , result , NULL );
402
408
return result ;
0 commit comments