gh-148871: make LOAD_COMMON_CONSTANT use immortal stackref borrows (GH-149625)

This commit is contained in:
Neko Asakura 2026-05-28 19:27:37 +08:00 committed by GitHub
parent 2531cd337b
commit 39bd44fc70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 96 additions and 43 deletions

View file

@ -1974,7 +1974,7 @@ dummy_func(
inst(LOAD_COMMON_CONSTANT, ( -- value)) {
// Keep in sync with _common_constants in opcode.py
assert(oparg < NUM_COMMON_CONSTANTS);
value = PyStackRef_FromPyObjectNew(tstate->interp->common_consts[oparg]);
value = PyStackRef_DupImmortal(tstate->interp->common_consts[oparg]);
}
inst(LOAD_BUILD_CLASS, ( -- bc)) {