-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ILStrip task incorrectly adds a body to extern
methods
#102045
Comments
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices |
Tagging subscribers to this area: @directhex |
The reason this affects Mono's |
The prior behavior assumed a MethodDefinition's RVA value of 0 meant an effectively empty body with a single RET instruction. This change removes the RET insertion and leaves the method completely empty. This is important for mono's UnsafeAccessor detection around methods specified as extern as it uses a quicker method of an empty vs non-empty body to bypass loading / checking custom attributes. Fixes dotnet/runtime#102045
If you run the ILStrip task on an assembly that contains an
extern
method that has no body or header, ILStrip adds one back.Original IL:
After ILStrip:
This affects UnsafeAccessor support on Apple mobile platforms (both the runtime samples and xamarin-macios use the ILStrip task). related to #89439, #99830
The text was updated successfully, but these errors were encountered: