mirror of
https://github.com/python/cpython.git
synced 2026-04-20 02:40:59 +00:00
gh-148210: fix incorrect _BINARY_OP_SUBSCR_DICT JIT optimization (GH-148213)
This commit is contained in:
parent
bb03c8bd02
commit
6e081614eb
3 changed files with 25 additions and 10 deletions
|
|
@ -515,18 +515,18 @@ dummy_func(void) {
|
|||
}
|
||||
|
||||
op(_BINARY_OP_SUBSCR_DICT, (dict_st, sub_st -- res, ds, ss)) {
|
||||
PyObject *sub = sym_get_const(ctx, sub_st);
|
||||
if (sub != NULL) {
|
||||
optimize_dict_known_hash(ctx, dependencies, this_instr,
|
||||
sub, _BINARY_OP_SUBSCR_DICT_KNOWN_HASH);
|
||||
}
|
||||
res = sym_new_not_null(ctx);
|
||||
ds = dict_st;
|
||||
ss = sub_st;
|
||||
PyObject *sub = sym_get_const(ctx, sub_st);
|
||||
if (sym_is_not_container(sub_st) &&
|
||||
sym_matches_type(dict_st, &PyFrozenDict_Type)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(dict_st, sub_st, res);
|
||||
}
|
||||
else if (sub != NULL) {
|
||||
optimize_dict_known_hash(ctx, dependencies, this_instr,
|
||||
sub, _BINARY_OP_SUBSCR_DICT_KNOWN_HASH);
|
||||
}
|
||||
}
|
||||
|
||||
op(_BINARY_OP_SUBSCR_LIST_SLICE, (list_st, sub_st -- res, ls, ss)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue