Skip to content

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

Merged
p-sawicki merged 1 commit into
python:masterfrom
p-sawicki:list_ops-error-clean-up
Oct 20, 2026
Merged

p-sawicki merged 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.

@p-sawicki
p-sawicki merged commit 4124ade into python:master Oct 20, 2026
18 checks passed
@p-sawicki
p-sawicki deleted the list_ops-error-clean-up branch October 20, 2026 15:55
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