GH-131798: Narrow the result type of _BINARY_OP_SUBSCR_STR_INT to str in the JIT (GH-132153)

This commit is contained in:
Tomas R. 2025-04-08 17:22:54 +02:00 committed by GitHub
parent 933c6653cb
commit 71009cb835
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 1 deletions

View file

@ -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) {