diff options
author | Nadeshiko Manju <me@manjusaka.me> | 2025-05-22 21:54:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-22 09:54:57 -0400 |
commit | 8c5e5557c64a8d6310b2a958f576d5eb245cb1b6 (patch) | |
tree | b62a68f174604b362971d5f6c28accf174561f31 /Python/optimizer_bytecodes.c | |
parent | 3effede97cc13fc0c5ab5dcde26cc319f388e84c (diff) | |
download | cpython-8c5e5557c64a8d6310b2a958f576d5eb245cb1b6.tar.gz cpython-8c5e5557c64a8d6310b2a958f576d5eb245cb1b6.zip |
GH-131798: Turn _LOAD_SMALL_INT into _LOAD_CONST_INLINE_BORROW in the JIT (GH-134406)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index f12cd7b968c..b9ebd8678e0 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -528,7 +528,10 @@ dummy_func(void) { } op(_LOAD_SMALL_INT, (-- value)) { - PyObject *val = PyLong_FromLong(this_instr->oparg); + PyObject *val = PyLong_FromLong(oparg); + assert(val); + assert(_Py_IsImmortal(val)); + REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val); value = sym_new_const(ctx, val); } |