Skip to content
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

TransformDisplayClassUsage: Support methods without .locals init #1781

Closed
yyjdelete opened this issue Nov 4, 2019 · 1 comment
Closed

TransformDisplayClassUsage: Support methods without .locals init #1781

yyjdelete opened this issue Nov 4, 2019 · 1 comment
Labels
Bug C# Decompiler The decompiler engine itself

Comments

@yyjdelete
Copy link
Contributor

Tested with master(6.0.0.5337-alpha1)

I don't have an minimum reproduce with C# code, but can be tested with Assemblies from netcoreapp3.0. Seems need an method without .locals init, and variable.HasInitialValue is false here.

if (context.Settings.LocalFunctions && closureType?.Kind == TypeKind.Struct && variable.HasInitialValue && IsPotentialClosure(this.context, closureType)) {

[System.Linq]System.Collections.Generic.LargeArrayBuilder<T>.CopyTo(CopyPosition position, T[] array, int arrayIndex, int count)(netcoreapp3.0)
and
[System.Text.Json]System.Text.Json.JsonNode.Parse(...)(netcoreapp5.0 ONLY)

@siegfriedpammer
Copy link
Member

Seems like in .NET 5.0 C# will no longer emit .locals init by default.

@siegfriedpammer siegfriedpammer added Bug C# Decompiler The decompiler engine itself labels Dec 1, 2019
@siegfriedpammer siegfriedpammer changed the title Some DisplayClass in local function is not removed. TransformDisplayClassUsage: Support methods without .locals init Feb 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug C# Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

2 participants