[Python-checkins] bpo-33387: Fix compiler warning in frame_block_unwind() (GH-18099)

Victor Stinner webhook-mailer at python.org
Tue Jan 21 06:47:34 EST 2020


https://github.com/python/cpython/commit/629023c05be24fa2f01c914c739aaa5a61a0304c
commit: 629023c05be24fa2f01c914c739aaa5a61a0304c
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-01-21T12:47:29+01:00
summary:

bpo-33387: Fix compiler warning in frame_block_unwind() (GH-18099)

Replace int with intptr_t to fix the warning:

    objects\frameobject.c(341): warning C4244: 'initializing':
    conversion from '__int64' to 'int', possible loss of data

files:
M Objects/frameobject.c

diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index d7acb41f7a3a1..4469e3c20cd2f 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -338,7 +338,7 @@ frame_block_unwind(PyFrameObject *f)
     assert(f->f_iblock > 0);
     f->f_iblock--;
     PyTryBlock *b = &f->f_blockstack[f->f_iblock];
-    int delta = (f->f_stacktop - f->f_valuestack) - b->b_level;
+    intptr_t delta = (f->f_stacktop - f->f_valuestack) - b->b_level;
     while (delta > 0) {
         frame_stack_pop(f);
         delta--;



More information about the Python-checkins mailing list