Skip to content

[mypyc] Fix reference leak on list set item failure - #22235

Open
p-sawicki wants to merge 1 commit into
python:masterfrom
p-sawicki:list_ops-error-clean-up
Open

p-sawicki wants to merge 1 commit into
python:masterfrom
p-sawicki:list_ops-error-clean-up

Conversation

@p-sawicki

@p-sawicki p-sawicki commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Add missing decrefs for values passed to list set item and build functions, as they steal the references on success.

In set item functions, decref the old reference only after setting the new one, as the decref might run a destructor that modifies the list causing the set to crash.

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.

2 participants