-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
.NET 9.0.200 broke ICSharpCode.Decompiler due to changed IL generation for yield return #3396
Comments
|
is introduced with this dotnet/roslyn#75908 |
Thank you for reporting! However, we will have to postpone fixing this issue until there is a newer NuGet release of Roslyn, so that we can add it to our unit tests and fix all the various changes in the C# compiler code-gen. This way we can make sure that we don't break older compiler versions and have a larger set of test cases available with no additional work to do. |
Thanks. I could pass ILPretty test by inserting the following case statement after this case statement: ILSpy/ICSharpCode.Decompiler/IL/ControlFlow/StateRangeAnalysis.cs Lines 214 to 227 in 7d715a4
case StObj stobj when mode == StateRangeAnalysisMode.IteratorDispose:
{
if (stobj.MatchStFld(out var target, out var field, out var value) && target.MatchLdThis())
{
if (field.IsCompilerGeneratedOrIsInCompilerGeneratedClass() && (value.MatchDefaultValue(out _) || value.MatchLdNull()))
{
// >= .net 9.0.200 clears hoisted locals
// don't consider this user code.
return stateRange;
}
if (field.MemberDefinition == stateField && value.MatchLdcI4(-2))
{
// >= .net 9.0.200 sets the state field during Dispose();
// don't consider this user code.
return stateRange;
}
}
goto default;
} But I'm unsure about the |
Input code
Erroneous output
9.0.103
9.0.200
Details
Generated IL is slightly changed after 9.0.200
9.0.103
9.0.200
diff for you
I think it would be equivalent to this
If there are captured enumerators, then they set default them.
equivalent to
The text was updated successfully, but these errors were encountered: