Skip to content

Commit b0e695f

Browse files
committed
Fix missing cast
1 parent b067e3e commit b0e695f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Include/cpython/pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct _ts {
112112
int py_recursion_remaining;
113113
int py_recursion_limit;
114114

115-
int c_recursion_remaining;
115+
int c_recursion_remaining; /* Retained for backwards compatibility. Do not use */
116116
int recursion_headroom; /* Allow 50 more calls to handle any errors. */
117117

118118
/* 'tracing' keeps track of the execution depth when tracing/profiling.

Python/pythonrun.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,10 +1543,11 @@ int PyOS_CheckStack(void)
15431543
char here;
15441544
uintptr_t here_addr = (uintptr_t)&here;
15451545
PyThreadState *tstate = _PyThreadState_GET();
1546-
if (tstate->c_stack_hard_limit == 0) {
1546+
_PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
1547+
if (_tstate->c_stack_hard_limit == 0) {
15471548
_Py_InitializeRecursionLimits(tstate);
15481549
}
1549-
if (here_addr >= tstate->c_stack_soft_limit) {
1550+
if (here_addr >= _tstate->c_stack_soft_limit) {
15501551
return 0;
15511552
}
15521553
else {

0 commit comments

Comments
 (0)