Skip to content

Update ILVerify to honor the "async" flag - #121503

Merged
jakobbotsch merged 2 commits into
dotnet:mainfrom
jcouv:async-ilverify
Nov 13, 2025
Merged

Update ILVerify to honor the "async" flag#121503
jakobbotsch merged 2 commits into
dotnet:mainfrom
jcouv:async-ilverify

Conversation

@jcouv

@jcouvjcouv commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Runtime specification: https://github.com/dotnet/runtime/blob/main/docs/design/specs/runtime-async.md

Note: ilasm/ildasm were already updated to recognize the "async" keyword

Relates to test plan dotnet/roslyn#75960

@jcouvjcouv self-assigned this Nov 10, 2025
@github-actionsgithub-actionsBot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 10, 2025
@jkotasjkotas added runtime-async area-Tools-ILVerification Issues related to ilverify tool and IL verification in general and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 10, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

@jcouv
jcouv marked this pull request as ready for review November 10, 2025 18:50
CopilotAI review requested due to automatic review settings November 10, 2025 18:50

CopilotAI 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 adds support for async method verification in ILVerification. The changes enable the verifier to properly handle async methods that return Task or ValueTask types by unwrapping their return types and validating the stack state accordingly.

Key changes:

  • Modified return statement verification logic to detect async methods and unwrap Task/ValueTask return types
  • Added helper method to identify and unwrap Task, ValueTask, Task, and ValueTask types
  • Added comprehensive test coverage for async method verification scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
src/tests/ilverify/ILTests/RuntimeAsyncTests.ilprojProject file for new async method verification tests
src/tests/ilverify/ILTests/RuntimeAsyncTests.ilIL test cases covering valid and invalid async method patterns
src/coreclr/tools/ILVerification/ILImporter.Verify.csImplementation of async method return type validation logic

Comment threadsrc/tests/ilverify/ILTests/RuntimeAsyncTests.il Outdated
Comment threadsrc/tests/ilverify/ILTests/RuntimeAsyncTests.il
@jakobbotsch

Copy link
Copy Markdown
Member

/ba-g Timeouts

@jakobbotsch

Copy link
Copy Markdown
Member

I am not sure if ILVerify tests are running in outerloop. I don't see an "ilverify" work item, and when I follow the instructions in the readme I do not get any ILVerificationTests.cmd file. @jkoritzinsky Fall out from test merging? Any idea how to run these tests now?

@jakobbotsch

jakobbotsch commented Nov 13, 2025

Copy link
Copy Markdown
Member

I think Jeremy is OOF. I was able to validate the tests locally so I think this is good to merge. I opened #121594 about the testing.

@jakobbotsch
jakobbotsch merged commit 195ad74 into dotnet:mainNov 13, 2025
109 of 122 checks passed
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Dec 14, 2025
@jcouv
jcouv deleted the async-ilverify branch February 14, 2026 18:39
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Tools-ILVerificationIssues related to ilverify tool and IL verification in generalruntime-async

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jcouv@jakobbotsch@jkotas