Skip to content

Allow the other async variant in AsyncMaskingILProvider - #121813

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:maskingil
Nov 19, 2025
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:maskingil

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

This codepath is hittable since we still scan compiler generated code (we do not generate any warnings for it).

Cc @dotnet/ilc-contrib

This codepath is hittable since we still scan compiler generated code (we do not generate any warnings for it).
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an assertion failure in AsyncMaskingILProvider.WrapIL by adding an IsAsync check before processing async variant methods. The assertion was failing because the code path is reachable when scanning compiler-generated code where async variants may exist without the IsAsync flag set to true.

  • Adds IsAsync condition to match the pattern used in GetMethodIL (line 33)
  • Removes the now-redundant Debug.Assert since the condition guards against the previously asserted case
  • Prevents attempting to unwrap async variants that don't have the IsAsync flag

@jkotas
jkotas requested a review from jtschuster November 19, 2025 19:12
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/ba-g deadletter on android

@MichalStrehovsky
MichalStrehovsky merged commit e38c777 into dotnet:main Nov 19, 2025
@MichalStrehovsky
MichalStrehovsky deleted the maskingil branch November 19, 2025 21:56
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants