[Python-checkins] gh-106529: Silence compiler warning in jump target patching (#106613)

gvanrossum webhook-mailer at python.org
Mon Jul 10 22:12:35 EDT 2023


https://github.com/python/cpython/commit/4bd8320dd7922d529eab51753dd524e8bf9c47b2
commit: 4bd8320dd7922d529eab51753dd524e8bf9c47b2
branch: main
author: Guido van Rossum <guido at python.org>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2023-07-10T19:12:32-07:00
summary:

gh-106529: Silence compiler warning in jump target patching (#106613)

(gh-106551 caused a compiler warning about on Windows.)

files:
M Python/optimizer.c

diff --git a/Python/optimizer.c b/Python/optimizer.c
index 48c29f55bee46..08073193c0228 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -548,8 +548,8 @@ translate_bytecode_to_trace(
                 if (trace[i].opcode == _POP_JUMP_IF_FALSE ||
                     trace[i].opcode == _POP_JUMP_IF_TRUE)
                 {
-                    int target = trace[i].operand;
-                    if (target >= max_length) {
+                    uint64_t target = trace[i].operand;
+                    if (target >= (uint64_t)max_length) {
                         target += trace_length - max_length;
                         trace[i].operand = target;
                     }



More information about the Python-checkins mailing list