GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)

This commit is contained in:
Amit Lavon 2025-03-30 16:07:25 -07:00 committed by GitHub
parent 39fa19a4cc
commit 685fd74f81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 185 additions and 125 deletions

View file

@ -414,10 +414,16 @@ dummy_func(void) {
}
}
op(_GUARD_TOS_UNICODE, (value -- value)) {
if (sym_matches_type(value, &PyUnicode_Type)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
sym_set_type(value, &PyUnicode_Type);
}
op(_TO_BOOL_STR, (value -- res)) {
if (!optimize_to_bool(this_instr, ctx, value, &res)) {
res = sym_new_truthiness(ctx, value, true);
sym_set_type(value, &PyUnicode_Type);
}
}