@@ -3634,8 +3634,14 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
3634
3634
res = call_function (& sp , oparg , names );
3635
3635
#endif
3636
3636
stack_pointer = sp ;
3637
- PUSH (res );
3638
3637
Py_DECREF (names );
3638
+ #ifdef STACKLESS
3639
+ if (STACKLESS_UNWINDING (res )) {
3640
+ retval = res ;
3641
+ goto stackless_call ;
3642
+ }
3643
+ #endif
3644
+ PUSH (res );
3639
3645
3640
3646
if (res == NULL ) {
3641
3647
goto error ;
@@ -3660,6 +3666,13 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
3660
3666
Py_DECREF (func );
3661
3667
Py_DECREF (callargs );
3662
3668
Py_XDECREF (kwargs );
3669
+ #ifdef STACKLESS
3670
+ if (STACKLESS_UNWINDING (result )) {
3671
+ retval = result ;
3672
+ POP (); /* compensate for the PUSH(res) after label stackless_call_return: */
3673
+ goto stackless_call ;
3674
+ }
3675
+ #endif
3663
3676
3664
3677
SET_TOP (result );
3665
3678
if (result == NULL ) {
@@ -5507,13 +5520,13 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *names
5507
5520
}
5508
5521
else {
5509
5522
Py_INCREF (func );
5510
- STACKLESS_ASSERT ();
5511
5523
}
5512
5524
5513
5525
READ_TIMESTAMP (* pintr0 );
5514
5526
if (PyFunction_Check (func )) {
5515
5527
STACKLESS_PROPOSE_ALL ();
5516
5528
x = fast_function (func , pp_stack , nargs , names );
5529
+ STACKLESS_ASSERT ();
5517
5530
} else {
5518
5531
x = do_call (func , pp_stack , nargs , names );
5519
5532
}
@@ -5837,6 +5850,7 @@ do_call(PyObject *func, PyObject ***pp_stack, Py_ssize_t nargs, PyObject *kwname
5837
5850
static PyObject *
5838
5851
do_call_core (PyObject * func , PyObject * callargs , PyObject * kwdict )
5839
5852
{
5853
+ PyObject * result ;
5840
5854
#ifdef CALL_PROFILE
5841
5855
/* At this point, we have to look at the type of func to
5842
5856
update the call stats properly. Do it here so as to avoid
@@ -5853,15 +5867,19 @@ do_call_core(PyObject *func, PyObject *callargs, PyObject *kwdict)
5853
5867
else
5854
5868
PCALL (PCALL_OTHER );
5855
5869
#endif
5870
+
5871
+ STACKLESS_PROPOSE_ALL ();
5856
5872
if (PyCFunction_Check (func )) {
5857
- PyObject * result ;
5858
5873
PyThreadState * tstate = PyThreadState_GET ();
5859
5874
C_TRACE (result , PyCFunction_Call (func , callargs , kwdict ));
5860
5875
return result ;
5861
5876
}
5862
5877
else {
5863
- return PyObject_Call (func , callargs , kwdict );
5878
+ result = PyObject_Call (func , callargs , kwdict );
5864
5879
}
5880
+ STACKLESS_ASSERT ();
5881
+
5882
+ return result ;
5865
5883
}
5866
5884
5867
5885
/* Extract a slice index from a PyLong or an object with the
0 commit comments