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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields #105686

Merged
merged 2 commits into from
Jun 12, 2023

Commits on Jun 12, 2023

  1. pythongh-105375: Explicitly initialise all {Pickler,Unpickler}Object …

    …fields
    
    PyObject_GC_New() only initialises the object header. All other fields
    must be explicitly initialised to prevent manipulation of uninitialised
    fields in dealloc.
    
    Align initialisation order with the layout of the object structs.
    erlend-aasland committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    eb0dd9b View commit details
    Browse the repository at this point in the history
  2. Make object init cleaner:

    - Prepare memory allocations and new objects before calling PyObject_GC_New()
    - Initialise all fields at once using a series of assignments only
    - Use error labels for clarity
    erlend-aasland committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    e4fd637 View commit details
    Browse the repository at this point in the history