Skip to content

gh-145866: Convert SET_UPDATE to leave its inputs on the stack to be cleaned up by _POP_TOP#145979

Open
Sacul0457 wants to merge 3 commits intopython:mainfrom
Sacul0457:Optimize_SET_UPDATE
Open

gh-145866: Convert SET_UPDATE to leave its inputs on the stack to be cleaned up by _POP_TOP#145979
Sacul0457 wants to merge 3 commits intopython:mainfrom
Sacul0457:Optimize_SET_UPDATE

Conversation

@Sacul0457
Copy link
Contributor

@Sacul0457 Sacul0457 commented Mar 15, 2026

Comment on lines +2172 to +2176
i = iterable;
DEAD(iterable);
if (err < 0) {
ERROR_NO_POP();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i should transfer ownership only after the error branch case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, should I do the same for this too?

Copy link
Member

@Fidget-Spinner Fidget-Spinner Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. It doesn't affect the generated code at the moment, but it does affect the correctness/reasoning.

The reasoning is as follows:

  1. We call ERROR_NO_POP in the error branch, implying everything on the stack is a live value.
  2. However, the current code marks the stack value as dead before the ERROR_NO_POP.
  3. and 2. are contradicting each other.

@Sacul0457
Copy link
Contributor Author

I believe the failure isn't related to the pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants