Skip to content

gh-131798: Use sym_new_type instead of sym_new_not_null for _BUILD_STRING, _BUILD_SET #132564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 27, 2025
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Use ``sym_new_type`` instead of ``sym_new_not_null`` for _BUILD_STRING,
_BUILD_SET
8 changes: 8 additions & 0 deletions Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,14 @@ dummy_func(void) {
map = sym_new_type(ctx, &PyDict_Type);
}

op(_BUILD_STRING, (values[oparg] -- str)) {
str = sym_new_type(ctx, &PyUnicode_Type);
}

op(_BUILD_SET, (values[oparg] -- set)) {
set = sym_new_type(ctx, &PySet_Type);
}

op(_UNPACK_SEQUENCE_TWO_TUPLE, (seq -- val1, val0)) {
val0 = sym_tuple_getitem(ctx, seq, 0);
val1 = sym_tuple_getitem(ctx, seq, 1);
Expand Down
4 changes: 2 additions & 2 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading