_Py_TryIncrefCompareStackRef incorrectly listed as non-escaping in cases generator
@DinoV arbeitet bereits daran.
Seit 29.1.2025.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug report
Bug description:
(This came up during the faster-cpython meeting, filing a bug so we don't forget.)
_Py_TryIncrefCompareStackRef and _Py_TryIncrefCompare are currently listed as non-escaping in the bytecode cases generator (https://github.com/python/cpython/blob/99ed3025fe8fa9079b4c1eac01c5af62caa98c15/Tools/cases_generator/analyzer.py#L635), but they can in fact escape (in the DECREF path when we're no longer sure the object we INCREF'ed is a correct object, since it may have been a pointer to a new object in re-used memory). _Py_TryIncrefCompare isn't currently used in bytecodes.c, but _Py_TryIncrefCompareStackRef is used in LOAD_ATTR specializations, which are consequently incorrectly flagged as non-escaping (and also can also theoretically cause crashes because of the missing spilling).
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.