-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add test for runtime async and update linker handling of method body #120683
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 runtime async methods in the linker's dataflow analysis and test infrastructure. It fixes an issue where the linker would incorrectly validate IL for runtime async methods that return Task but don't have a value on the stack for the ret
instruction.
Key changes:
- Adds test infrastructure support for
/features
and/nowarn
compiler arguments - Creates comprehensive test cases for runtime async methods with various dataflow scenarios
- Updates method body scanner to handle runtime async methods correctly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
TestCaseCompiler.cs | Adds support for /features and /nowarn compiler arguments in test compilation |
RuntimeAsyncMethods.cs | New test file with comprehensive coverage of runtime async method dataflow scenarios |
MethodDefinitionExtensions.cs | Adds IsRuntimeAsync() extension method to detect runtime async methods |
MethodBodyScanner.cs | Updates IL validation logic to handle runtime async methods that don't have return values on stack |
features.Add(feature[..featureSplit], feature[(featureSplit + 1)..]); | ||
break; | ||
} | ||
else if(splitIndex != -1 && option[..splitIndex] == "/nowarn") |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after 'if' keyword. Should be 'else if (' to maintain consistent formatting with the rest of the codebase.
else if(splitIndex != -1 && option[..splitIndex] == "/nowarn") | |
else if (splitIndex != -1 && option[..splitIndex] == "/nowarn") |
Copilot uses AI. Check for mistakes.
Tagging subscribers to this area: @dotnet/illink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Fixes #120340
Adds test with some rutnime async methods, and fixes the check for invalid IL when a Task returning async method doesn't have a value on the stack for
ret
.