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

Use correct IL offset when reporting dataflow warnings for return statements #105661

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jul 29, 2024

Instead of merging all returned values into a single return value and reporting warnings based on that, report warnings per return statement, using the IL offset at that point. This allows us to fix the message origin to match the IL offset of each individual return statement, so we can remove a workaround from the pattern store.

Fixes dotnet/linker#2778

@dotnet/appmodel PTAL

@sbomer
Copy link
Member Author

sbomer commented Aug 6, 2024

@vitek-karas @MichalStrehovsky PTAL

@am11 am11 added linkable-framework Issues associated with delivering a linker friendly framework area-Tools-ILLink .NET linker development as well as trimming analyzers and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 6, 2024
Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

Nice - thanks a lot.

…thodBodyScanner.cs

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
@sbomer sbomer merged commit be6184f into dotnet:main Aug 7, 2024
108 of 113 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linker tracks wrong IL offset for return values
4 participants