mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-130415: Narrow int to 0 based on boolean tests (GH-130772)
This commit is contained in:
parent
e20e47dda6
commit
c989e74446
6 changed files with 38 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue