mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
gh-148083: Prevent constant folding when lhs is container types (gh-148090)
This commit is contained in:
@@ -515,7 +515,8 @@ dummy_func(void) {
|
||||
res = sym_new_not_null(ctx);
|
||||
ds = dict_st;
|
||||
ss = sub_st;
|
||||
if (sym_matches_type(dict_st, &PyFrozenDict_Type)) {
|
||||
if (sym_is_not_container(sub_st) &&
|
||||
sym_matches_type(dict_st, &PyFrozenDict_Type)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(dict_st, sub_st, res);
|
||||
}
|
||||
}
|
||||
@@ -706,7 +707,8 @@ dummy_func(void) {
|
||||
b = sym_new_type(ctx, &PyBool_Type);
|
||||
l = left;
|
||||
r = right;
|
||||
if (sym_matches_type(right, &PyFrozenSet_Type)) {
|
||||
if (sym_is_not_container(left) &&
|
||||
sym_matches_type(right, &PyFrozenSet_Type)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right, b);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user