Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-40941: Fix stackdepth compiler warnings
Explicitly cast a difference of two pointers to int:
PyFrameObject.f_stackdepth is an int.
  • Loading branch information
vstinner committed Sep 23, 2020
commit 39da6cb6f095e5cce2bd5c07e829131f0f8f9947
8 changes: 4 additions & 4 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1443,9 +1443,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
if (_Py_TracingPossible(ceval2) &&
tstate->c_tracefunc != NULL && !tstate->tracing) {
int err;
/* see maybe_call_line_trace
/* see maybe_call_line_trace()
for expository comments */
f->f_stackdepth = stack_pointer-f->f_valuestack;
f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);

err = maybe_call_line_trace(tstate->c_tracefunc,
tstate->c_traceobj,
Expand Down Expand Up @@ -2275,7 +2275,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT));
f->f_lasti -= sizeof(_Py_CODEUNIT);
f->f_state = FRAME_SUSPENDED;
f->f_stackdepth = stack_pointer-f->f_valuestack;
f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);
goto exiting;
}

Expand All @@ -2292,7 +2292,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
retval = w;
}
f->f_state = FRAME_SUSPENDED;
f->f_stackdepth = stack_pointer-f->f_valuestack;
f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);
goto exiting;
}

Expand Down