Skip to content

Commit 6e23a9c

Browse files
authored
Fix MSVC warning in frameobject.c (GH-20590)
1 parent 586be6f commit 6e23a9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Objects/frameobject.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
397397
return -1;
398398
}
399399

400-
int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT);
400+
int len = Py_SAFE_DOWNCAST(
401+
PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT),
402+
Py_ssize_t, int);
401403
int *lines = marklines(f->f_code, len);
402404
if (lines == NULL) {
403405
return -1;

0 commit comments

Comments
 (0)