-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add AOT support for the EntryPoint property for UnmanagedCallersOnly. #44809
Conversation
…returns the beginning of the metadata string so its length can be computed.
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
a4b33ed
to
c0f837a
Compare
export_name [slen] = 0; | ||
} | ||
} | ||
g_free (named_args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g_free (named_args); | |
g_assert (!typed_args); | |
g_free (named_args); |
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
MonoMethod *wrapper; | ||
|
||
if (!(method->flags & METHOD_ATTRIBUTE_STATIC)) { | ||
g_warning ("AOT restriction: Method '%s' must be static since it is decorated with [UnmanagedCallers].", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this permanent limitation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's part of the spec of UnmanagedCallersOnlyAttribute
It is an error to apply the attribute to anything other than an ordinary static method or ordinary static local function. The C# compiler will mark any non-static or static non-ordinary methods imported from metadata with this attribute as unsupported by the language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we check only for this restriction then and shouldn't this be TLE or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just a copy paste from the MonoPInvokeCallback case.
Fixes #44803.