]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111386: Fix `uint32_t` cast in `generated_cases.c.h` (#111387)
authorNikita Sobolev <mail@sobolevn.me>
Fri, 27 Oct 2023 11:37:59 +0000 (14:37 +0300)
committerGitHub <noreply@github.com>
Fri, 27 Oct 2023 11:37:59 +0000 (12:37 +0100)
Python/bytecodes.c
Python/generated_cases.c.h

index 2d7b5ba21ea09df6291bc0f9177dd83e71b2ebcd..5b1d70b303060d2c86a5d6289b1f3770328af4ab 100644 (file)
@@ -2686,7 +2686,7 @@ dummy_func(
             assert(next_instr[oparg].op.code == END_FOR ||
                    next_instr[oparg].op.code == INSTRUMENTED_END_FOR);
             assert(1 + INLINE_CACHE_ENTRIES_FOR_ITER == next_instr - frame->instr_ptr);
-            frame->return_offset = 1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg;
+            frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
             DISPATCH_INLINED(gen_frame);
         }
 
index d5e0d849efe9d274438aa8843f40847a04b35842..fb4506e68765ecf4b35eac401da3f2a0c9d2f452 100644 (file)
             assert(next_instr[oparg].op.code == END_FOR ||
                    next_instr[oparg].op.code == INSTRUMENTED_END_FOR);
             assert(1 + INLINE_CACHE_ENTRIES_FOR_ITER == next_instr - frame->instr_ptr);
-            frame->return_offset = 1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg;
+            frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg);
             DISPATCH_INLINED(gen_frame);
         }