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

This commit is contained in:
Petr Viktorin 2024-07-17 11:31:28 +02:00 committed by GitHub
parent bfdbeac355
commit cffad5c6ef
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;
}