mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-130415: Narrow str to "" based on boolean tests (GH-130476)
This commit is contained in:
parent
b6769e9404
commit
691354ccb0
6 changed files with 40 additions and 2 deletions
2
Python/optimizer_cases.c.h
generated
2
Python/optimizer_cases.c.h
generated
|
@ -213,7 +213,7 @@
|
|||
JitOptSymbol *res;
|
||||
value = stack_pointer[-1];
|
||||
if (!optimize_to_bool(this_instr, ctx, value, &res)) {
|
||||
res = sym_new_type(ctx, &PyBool_Type);
|
||||
res = sym_new_truthiness(ctx, value, true);
|
||||
sym_set_type(value, &PyUnicode_Type);
|
||||
}
|
||||
stack_pointer[-1] = res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue