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

Temporaries generated by LocalRewriter for collection expression spans should be marked as long-lived #73246

Open
cston opened this issue Apr 26, 2024 · 1 comment

Comments

@cston
Copy link
Member

cston commented Apr 26, 2024

The temporaries generated by LocalRewriter for collection expression spans are created at the outermost scope of the method and span multiple statements or sequence points, and therefore should be considered long-lived locals.

Currently however, the temporaries are created with SynthesizedLocalKind.LoweringTemp, for which SynthesizedLocalExtensions.IsLongLived(kind) returns false.

The fact that the temp locals are not considered long-lived may cause issues for the following:

  • EnC which matches locals across method versions
  • SpillSequenceSpiller which rewrites locals that are not long-lived (although currently ref struct instances cannot be used across await)

Based on comment and discussion with @AlekseyTs.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 26, 2024
@cston
Copy link
Member Author

cston commented Apr 26, 2024

cc @tmat

@jaredpar jaredpar added Bug Feature - Collection Expressions and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 27, 2024
@jaredpar jaredpar added this to the 17.11 milestone Apr 27, 2024
@jaredpar jaredpar modified the milestones: 17.11, Backlog May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants