]> granicus.if.org Git - python/commitdiff
bpo-33041: Fix downcast warning on Windows (#6595)
authorVictor Stinner <vstinner@redhat.com>
Fri, 27 Apr 2018 12:30:01 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Apr 2018 12:30:01 +0000 (14:30 +0200)
Cast pointer difference from ssize_t to int: a frame is very unlikely
larger than 2 GB.

Objects/frameobject.c

index 864a8f977ea39849c78a9d1b965dd77b14ebb1bc..14935a2147c4b8bb5de2e0e25caa8847f2d24665 100644 (file)
@@ -297,7 +297,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
     if (delta_iblock > 0) {
         f->f_iblock -= delta_iblock;
         PyTryBlock *b = &f->f_blockstack[f->f_iblock];
-        delta += (f->f_stacktop - f->f_valuestack) - b->b_level;
+        delta += (int)(f->f_stacktop - f->f_valuestack) - b->b_level;
         if (b->b_type == SETUP_FINALLY &&
             code[b->b_handler] == WITH_CLEANUP_START)
         {