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

Fix the ordering of COM interface methods, properties, and events to appear in their originally defined order #2639

Merged
merged 4 commits into from
Apr 12, 2022

Conversation

zhuman
Copy link
Contributor

@zhuman zhuman commented Mar 5, 2022

… This was resulting in fatal crashes while running decompiled COM interop code.

#2638

Problem

See #2638 for more details on the problem being solved

Solution

  • I have factored out the problem of determining whether native member ordering is required into its own function. If it's not required, ILSpy will still group the members by kind (fields, properties, methods, events).
  • Added a new correctness unit test that validates COM V-table ordering does not change across a decompile loop

@siegfriedpammer siegfriedpammer self-assigned this Mar 7, 2022
@zhuman
Copy link
Contributor Author

zhuman commented Mar 10, 2022

Ah, I see ILSpy just moved to .NET 6 in the intervening week and broke my test haha. I will update it to something that works with .NET 6.

@siegfriedpammer siegfriedpammer merged commit b834bcf into icsharpcode:master Apr 12, 2022
@siegfriedpammer
Copy link
Member

Thank you for your contribution! Sorry for taking so long to get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

COM interface method/property ordering is not preserved in decompiled output
2 participants