From 2d26094efc6b7308b2353de9e99d19fac59b6ffa Mon Sep 17 00:00:00 2001
From: Ammar Askar <ammar@ammaraskar.com>
Date: Tue, 2 Jun 2020 01:13:43 -0700
Subject: [PATCH] Fix MSVC warning in frameobject.c

---
 Objects/frameobject.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index af32276c98b24a..b6d073bd456d03 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;