summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_bytecodes.c
diff options
context:
space:
mode:
authorKlaus117 <keenanlau12@gmail.com>2025-03-04 20:44:09 (GMT)
committerGitHub <noreply@github.com>2025-03-04 20:44:09 (GMT)
commitc989e74446836ce8a00ae002d4c229c81e1f7905 (patch)
tree9025e9d51c1e1dc0baf47cb0875cfdc7e6623c57 /Python/optimizer_bytecodes.c
parente20e47dda67451d24e8b3f5784d64135abebf92f (diff)
downloadcpython-c989e74446836ce8a00ae002d4c229c81e1f7905.zip
cpython-c989e74446836ce8a00ae002d4c229c81e1f7905.tar.gz
cpython-c989e74446836ce8a00ae002d4c229c81e1f7905.tar.bz2
GH-130415: Narrow int to 0 based on boolean tests (GH-130772)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r--Python/optimizer_bytecodes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index c4e4b28..2aeed24 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -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);
}
}