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

Provide an analyzer to detect incorrect function pointer invocation when marshaling is disabled #234

Open
PathogenDavid opened this issue Feb 12, 2022 · 0 comments
Labels
Area-CodeAnalysis Issues concerning a C# code analysis. Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Concept-OutputUsability Issues concerning whether or not the output from Biohazrd is actually usable Language-C# Issues specific to C#

Comments

@PathogenDavid
Copy link
Member

Relates to #233

Having marshaling disabled introduces an awkward situation for function pointers which cross assembly bounds. If a function pointer from a no-marshaling assembly is invoked from a legacy yes-marshaling assembly the invocation may fail at runtime.

In order to guide Mochi consumers to correct behavior we should introduce an analyzer to detect bad situations and warn developers that they either need to apply DisableRuntimeMarshalling or use some other sort of workaround.

In the simplest form, this would be an analyzer which warns when a yes-marshaling assembly references a no-marshaling assembly.

In a more complex form it would check if a yes-marshaling assembly accesses a function pointer from a no-marshaling assembly.

@PathogenDavid PathogenDavid added Language-C# Issues specific to C# Concept-OutputUsability Issues concerning whether or not the output from Biohazrd is actually usable Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Area-CodeAnalysis Issues concerning a C# code analysis. labels Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeAnalysis Issues concerning a C# code analysis. Concept-OutputFriendliness Issues concerning the friendliness of using the Biohazrd output Concept-OutputUsability Issues concerning whether or not the output from Biohazrd is actually usable Language-C# Issues specific to C#
Projects
None yet
Development

No branches or pull requests

1 participant