]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix MSVC warning in frameobject.c (GH-20590)
authorAmmar Askar <ammar@ammaraskar.com>
Thu, 4 Jun 2020 05:19:23 +0000 (05:19 +0000)
committerGitHub <noreply@github.com>
Thu, 4 Jun 2020 05:19:23 +0000 (06:19 +0100)
Objects/frameobject.c

index af32276c98b24af46b5d978939f7f9862480035b..b6d073bd456d03ba7630e4e49b1ba9ce62119be9 100644 (file)
@@ -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;