@@ -130,11 +130,13 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
130130#if GREENLET_PY311
131131 #if GREENLET_PY312
132132 this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
133- this ->c_recursion_depth = C_RECURSION_LIMIT - tstate->c_recursion_remaining ;
133+ this ->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining ;
134134 #else // not 312
135135 this ->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining ;
136136 #endif // GREENLET_PY312
137+ #if GREENLET_USE_CFRAME
137138 this ->current_frame = tstate->cframe ->current_frame ;
139+ #endif
138140 this ->datastack_chunk = tstate->datastack_chunk ;
139141 this ->datastack_top = tstate->datastack_top ;
140142 this ->datastack_limit = tstate->datastack_limit ;
@@ -199,12 +201,14 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
199201#if GREENLET_PY311
200202 #if GREENLET_PY312
201203 tstate->py_recursion_remaining = tstate->py_recursion_limit - this ->py_recursion_depth ;
202- tstate->c_recursion_remaining = C_RECURSION_LIMIT - this ->c_recursion_depth ;
204+ tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this ->c_recursion_depth ;
203205 this ->unexpose_frames ();
204206 #else // \/ 3.11
205207 tstate->recursion_remaining = tstate->recursion_limit - this ->recursion_depth ;
206208 #endif // GREENLET_PY312
209+ #if GREENLET_USE_CFRAME
207210 tstate->cframe ->current_frame = this ->current_frame ;
211+ #endif
208212 tstate->datastack_chunk = this ->datastack_chunk ;
209213 tstate->datastack_top = this ->datastack_top ;
210214 tstate->datastack_limit = this ->datastack_limit ;
@@ -238,7 +242,7 @@ void PythonState::set_initial_state(const PyThreadState* const tstate) noexcept
238242#if GREENLET_PY312
239243 this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
240244 // XXX: TODO: Comment from a reviewer:
241- // Should this be ``C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
245+ // Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
242246 // But to me it looks more like that might not be the right
243247 // initialization either?
244248 this ->c_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
0 commit comments