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

Support for C# 9 function pointers #2150

Merged
merged 5 commits into from
Sep 8, 2020
Merged

Support for C# 9 function pointers #2150

merged 5 commits into from
Sep 8, 2020

Conversation

dgrunwald
Copy link
Member

This PR adds support for C# 9.0 function pointer types (delegate*<...>) to the type system.

  • Function pointer types can be decoded from signatures
  • The calli translation is changed to convert to a function pointer type if necessary (not always inserting a cast).
  • The calli translation now supports managed references for parameter or return types.
  • The ldftn translation is changed to use the C# 9 "address of method-group" syntax.
  • Support for function pointer types added to type inference.
  • Conversions between IntPtr and function pointers are supported.
  • Variance conversions for function pointers are supported.

Not yet implemented here:
[ ] Taking the address of a static local function
[ ] The upcoming syntax change for calling conventions
[ ] Custom calling convention support

@christophwille christophwille added C# Decompiler The decompiler engine itself labels Sep 7, 2020
@dgrunwald dgrunwald merged commit 9d590e4 into master Sep 8, 2020
@christophwille christophwille deleted the fnptr branch November 15, 2020 12:56
ElektroKill added a commit to dnSpyEx/ILSpy that referenced this pull request Aug 9, 2021
Support for C# 9 function pointers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Decompiler The decompiler engine itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants