0xd4d / dnlib

Reads and writes .NET assemblies and modules
MIT License
2.14k stars 583 forks source link

Sort `ExportedType` table when writing to comply with new ECMA Augments #559

Closed ElektroKill closed 4 months ago

ElektroKill commented 4 months ago

fixes https://github.com/0xd4d/dnlib/issues/558

The algorithm suggested in the issue was adjusted to allow more than one nested type per exported type.

Something to consider: The current algorithm does not dispose of the enumerators generated just like the method in https://github.com/0xd4d/dnlib/blob/4e0837cb0f4319ffbcdd1642d1973fce203b2177/src/DotNet/AllTypesHelper.cs#L14. This should be fine since list enumerators don't contain any logic in their Dipose method but this is something we'd probably need to add to both implementations for future-proofing and potential reuse. Perhaps we could also extract this traversal into an additional class for future use.

wtfsck commented 4 months ago

Thanks, added an issue about disposing of enumerators: https://github.com/0xd4d/dnlib/issues/560