aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/optimizer_cases.c.h
diff options
context:
space:
mode:
authorAmit Lavon <amitlavon1.spam@gmail.com>2025-03-04 13:20:17 -0800
committerGitHub <noreply@github.com>2025-03-04 13:20:17 -0800
commit691354ccb04f0e8f4faa864ee5003fc5efe8377e (patch)
tree95bb10a3d80b696905565f6c42c4d045793c1b8e /Python/optimizer_cases.c.h
parentb6769e9404646e38d9c786984ef308c8e9747b91 (diff)
downloadcpython-691354ccb04f0e8f4faa864ee5003fc5efe8377e.tar.gz
cpython-691354ccb04f0e8f4faa864ee5003fc5efe8377e.zip
GH-130415: Narrow str to "" based on boolean tests (GH-130476)
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r--Python/optimizer_cases.c.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index 9555e141ed5..306599bea77 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -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;