Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-106168: PyTuple_SET_ITEM() now checks the index #106164

Merged
merged 2 commits into from Jun 28, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 27, 2023

PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument
with an assertion if Python is built in debug mode or is built with
assertions.

  • list_extend() and _PyList_AppendTakeRef() now set the list size
    before calling PyList_SET_ITEM().
  • PyStructSequence_GetItem() and PyStructSequence_SetItem() now check
    the index argument: must be lesser than REAL_SIZE(op).
  • PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now
    aliases to PyStructSequence_GetItem() and
    PyStructSequence_SetItem().

馃摎 Documentation preview 馃摎: https://cpython-previews--106164.org.readthedocs.build/

@vstinner vstinner changed the title PyList_GET_ITEM() now checks the index PyList_SET_ITEM() now checks the index Jun 27, 2023
@vstinner vstinner changed the title PyList_SET_ITEM() now checks the index gh-106168: PyTuple_SET_ITEM() now checks the index Jun 28, 2023
PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument
with an assertion if Python is built in debug mode or is built with
assertions.

* list_extend() and _PyList_AppendTakeRef() now set the list size
  before calling PyList_SET_ITEM().
* PyStructSequence_GetItem() and PyStructSequence_SetItem() now check
  the index argument: must be lesser than REAL_SIZE(op).
* PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now
  aliases to PyStructSequence_GetItem() and
  PyStructSequence_SetItem().
@vstinner vstinner merged commit 3f8483c into python:main Jun 28, 2023
21 checks passed
@vstinner vstinner deleted the list_get_item_assert branch June 28, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants