From 9bbad44bfed71ea32bc978dd62dfc5aa20a4bdf3 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 27 Oct 2023 09:12:14 +0300 Subject: [PATCH 1/3] gh-111386: Fix `uint32_t` cast in `generated_cases.c.h` --- Python/bytecodes.c | 2 +- Python/generated_cases.c.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 2d7b5ba21ea09d..bc5927aec43f60 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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); } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index d5e0d849efe9d2..843253fe87aa17 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -3440,7 +3440,7 @@ 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); } From c860adb6148b2ca2a930583c426d4782b2fc00b9 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:00:25 +0100 Subject: [PATCH 2/3] Update Python/bytecodes.c --- Python/bytecodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index bc5927aec43f60..5b1d70b303060d 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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 = (uint16_t)1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg; + frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg); DISPATCH_INLINED(gen_frame); } From fb6f3a4dbc2b28728553e31dce5f9383ec412913 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 27 Oct 2023 13:47:24 +0300 Subject: [PATCH 3/3] make regen-cases --- Python/generated_cases.c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 843253fe87aa17..fb4506e68765ec 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -3440,7 +3440,7 @@ 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 = (uint16_t)1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg; + frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg); DISPATCH_INLINED(gen_frame); }