GH-130415: Narrow int to 0 based on boolean tests (GH-130772)

This commit is contained in:
Klaus117 2025-03-04 12:44:09 -08:00 committed by GitHub
parent e20e47dda6
commit c989e74446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 2 deletions

View file

@ -406,7 +406,7 @@ dummy_func(void) {
op(_TO_BOOL_INT, (value -- res)) {
if (!optimize_to_bool(this_instr, ctx, value, &res)) {
sym_set_type(value, &PyLong_Type);
res = sym_new_type(ctx, &PyBool_Type);
res = sym_new_truthiness(ctx, value, true);
}
}