Skip to content

Commit c366767

Browse files
committed
add else case to set the type to PyBool_Type
1 parent 16f6ab0 commit c366767

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Python/optimizer_bytecodes.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,9 @@ dummy_func(void) {
20772077
int match = type->tp_flags & Py_TPFLAGS_MAPPING;
20782078
res = match ? sym_new_const(ctx, Py_True) : sym_new_const(ctx, Py_False);
20792079
}
2080+
else {
2081+
res = sym_new_type(ctx, &PyBool_Type);
2082+
}
20802083
}
20812084

20822085
op(_MATCH_SEQUENCE, (subject -- subject, res)) {
@@ -2085,6 +2088,9 @@ dummy_func(void) {
20852088
int match = type->tp_flags & Py_TPFLAGS_SEQUENCE;
20862089
res = match ? sym_new_const(ctx, Py_True) : sym_new_const(ctx, Py_False);
20872090
}
2091+
else {
2092+
res = sym_new_type(ctx, &PyBool_Type);
2093+
}
20882094
}
20892095

20902096
op(_DICT_UPDATE, (dict, unused[oparg - 1], update -- dict, unused[oparg - 1], upd)) {

Python/optimizer_cases.c.h

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)