diff options
author | Nadeshiko Manju <me@manjusaka.me> | 2025-04-08 16:12:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 16:12:09 (GMT) |
commit | d753d8aed738a4a2adedc24263af64d6f7051b4a (patch) | |
tree | f1170a03f2cdd2b07cc7bbe0b7f2408255d16539 /Python/optimizer_bytecodes.c | |
parent | 71009cb835f9fa37647b0f2f7dcc0d6ca8aa36b6 (diff) | |
download | cpython-d753d8aed738a4a2adedc24263af64d6f7051b4a.zip cpython-d753d8aed738a4a2adedc24263af64d6f7051b4a.tar.gz cpython-d753d8aed738a4a2adedc24263af64d6f7051b4a.tar.bz2 |
GH-131798: Narrow the result of _CONTAINS_OP_DICT to bool in the JIT (GH-132269)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 72dc2bb..0f7e183 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -485,6 +485,10 @@ dummy_func(void) { res = sym_new_type(ctx, &PyBool_Type); } + op(_CONTAINS_OP_DICT, (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; |