summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_bytecodes.c
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-05 22:56:01 (GMT)
committerGitHub <noreply@github.com>2025-04-05 22:56:01 (GMT)
commit85bc489b649fe261f9625163c684a69a470b3dc1 (patch)
tree43d078cac4313bfa7339f5dc881cec45a2196ed2 /Python/optimizer_bytecodes.c
parentad6a032cebf59d1668caa7e726aa5da72e1cbb5c (diff)
downloadcpython-85bc489b649fe261f9625163c684a69a470b3dc1.zip
cpython-85bc489b649fe261f9625163c684a69a470b3dc1.tar.gz
cpython-85bc489b649fe261f9625163c684a69a470b3dc1.tar.bz2
GH-131798: Narrow the result of _CONTAINS_OP_SET to bool in the JIT (GH-132057)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r--Python/optimizer_bytecodes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index da36704..d7b3564 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -477,6 +477,10 @@ dummy_func(void) {
res = sym_new_type(ctx, &PyBool_Type);
}
+ op(_CONTAINS_OP_SET, (left, right -- res)) {
+ res = sym_new_type(ctx, &PyBool_Type);
+ }
+
op(_LOAD_CONST, (-- value)) {
PyObject *val = PyTuple_GET_ITEM(co->co_consts, this_instr->oparg);
int opcode = _Py_IsImmortal(val) ? _LOAD_CONST_INLINE_BORROW : _LOAD_CONST_INLINE;