-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Remove unnecessary tracking of unmatched parameters in method invocation escape analysis #62847
Conversation
…ion escape analysis
@dotnet/roslyn-compiler, please review. |
@@ -1881,21 +1853,40 @@ void updateEscapeTo(BoundExpression argument, RefKind refKind, uint scopeOfTheCo | |||
}; | |||
} | |||
|
|||
#if DEBUG | |||
private static bool AllParametersHaveArguments( |
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.
It looks like we don't create arguments for params arrays during binding. #49602
Consider testing a case like:
using System;
Span<int> M1(Span<int> input, params object[] arr) { return input; }
Span<int> M2()
{
return M1(stackalloc int[] { 1, 2, 3 });
}
We might want to adjust this step to ensure that all parameters which may factor into escape analysis have arguments. Or just specifically permit a parameter with IsParams == true && Type.TypeKind == TypeKind.Array
here, since that's likely the only kind we will miss.
#Resolved
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.
Good catch, thanks.
@dotnet/roslyn-compiler, please review a small change to escape analysis, to simplify changes going forward. |
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 (iteration 2)
Fixes #62834.