[3.13] gh-121863: Immortalize names in code objects to avoid crash (GH-121903) (GH-121904)

(cherry picked from commit cffad5c6ef)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-07-17 11:55:22 +02:00 committed by GitHub
parent 09ff4ec14f
commit 72cd53ea15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View file

@ -147,7 +147,7 @@ intern_strings(PyObject *tuple)
"non-string found in code slot");
return -1;
}
_PyUnicode_InternMortal(interp, &_PyTuple_ITEMS(tuple)[i]);
_PyUnicode_InternImmortal(interp, &_PyTuple_ITEMS(tuple)[i]);
}
return 0;
}