Skip to content

Commit 65cae76

Browse files
add comment
1 parent ad15c8d commit 65cae76

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/optimizer_analysis.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ lookup_attr(JitOptContext *ctx, _PyBloomFilter *dependencies, _PyUOpInstruction
368368
PyObject *lookup = _PyType_Lookup(type, name);
369369
if (lookup) {
370370
int opcode = mortal;
371+
// if the object is immortal or the type is immutable, borrowing is safe
371372
if (_Py_IsImmortal(lookup) || (type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE)) {
372373
opcode = immortal;
373374
}

0 commit comments

Comments
 (0)