diff options
author | Tomas R. <tomas.roun8@gmail.com> | 2025-04-08 17:22:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 08:22:54 -0700 |
commit | 71009cb835f9fa37647b0f2f7dcc0d6ca8aa36b6 (patch) | |
tree | 01d1df72cad314acc50c57fc925e98f125caecb8 /Python/optimizer_bytecodes.c | |
parent | 933c6653cba235b3af2250bb19713694b560c367 (diff) | |
download | cpython-71009cb835f9fa37647b0f2f7dcc0d6ca8aa36b6.tar.gz cpython-71009cb835f9fa37647b0f2f7dcc0d6ca8aa36b6.zip |
GH-131798: Narrow the result type of _BINARY_OP_SUBSCR_STR_INT to str in the JIT (GH-132153)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index d7b3564db1b..72dc2bbd44e 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -366,6 +366,10 @@ dummy_func(void) { ctx->done = true; } + op(_BINARY_OP_SUBSCR_STR_INT, (left, right -- res)) { + res = sym_new_type(ctx, &PyUnicode_Type); + } + op(_TO_BOOL, (value -- res)) { int already_bool = optimize_to_bool(this_instr, ctx, value, &res); if (!already_bool) { |