From: Ammar Askar Date: Thu, 4 Jun 2020 05:19:23 +0000 (+0000) Subject: Fix MSVC warning in frameobject.c (GH-20590) X-Git-Tag: v3.10.0a1~730 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e23a9c82b7fd2366003b9191cd93a9683b9d80c;p=thirdparty%2FPython%2Fcpython.git Fix MSVC warning in frameobject.c (GH-20590) --- diff --git a/Objects/frameobject.c b/Objects/frameobject.c index af32276c98b2..b6d073bd456d 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -397,7 +397,9 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore return -1; } - int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT); + int len = Py_SAFE_DOWNCAST( + PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT), + Py_ssize_t, int); int *lines = marklines(f->f_code, len); if (lines == NULL) { return -1;