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 16105 - Release inline optimization leads to MethodAccessException if used with assembly:InternalsVisibleTo attribute #16737

Merged
merged 8 commits into from
Feb 27, 2024

Conversation

KevinRansom
Copy link
Member

@KevinRansom KevinRansom commented Feb 20, 2024

Fixes #16105

When doing cross assembly optimisation, the FSharp optimiser incorrectly inlines function calls from a second assembly that contain internal method calls to a third assembly assembly, with internals visible to.

The fix is to spot that the method call to an internal member in an external assembly is about to happen, and to not inline it.

This adds a couple of test cases, one for calling an internal Api with friends visible to. Also one calling a public member to ensure inlining still happens properly.

Also renames and moves a few test cases to ensure that when testing, file paths doesn't spill over the max path length.

@KevinRansom KevinRansom requested a review from a team as a code owner February 20, 2024 11:41
Copy link
Contributor

github-actions bot commented Feb 20, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.300.md

@KevinRansom KevinRansom changed the title Fix16105 Fix 16105 - Release inline optimization leads to MethodAccessException if used with assembly:InternalsVisibleTo attribute Feb 20, 2024
@KevinRansom KevinRansom added this to the February-2024 milestone Feb 24, 2024
@KevinRansom KevinRansom enabled auto-merge (squash) February 26, 2024 19:15
@KevinRansom KevinRansom self-assigned this Feb 26, 2024
@psfinaki
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@KevinRansom KevinRansom merged commit 1899bce into dotnet:main Feb 27, 2024
29 checks passed
psfinaki pushed a commit that referenced this pull request Feb 28, 2024
* Fix 16105 - Release inline optimization leads to MethodAccessException if used with assembly:InternalsVisibleTo attribute (#16737)

* Fix16105

* trimming

* Update release notes

---------

Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>

* fix wrong range start of INTERP_STRING_END (#16774)

* fix wrong range start of INTERP_STRING_END

* add release notes entry

---------

Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/arcade build 20240223.1 (#16776)

Microsoft.DotNet.Arcade.Sdk
 From Version 8.0.0-beta.24113.2 -> To Version 8.0.0-beta.24123.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>

* remove superseded test of TryGetRecentCheckResultsForFile (#16770)

* remove superseded test of TryGetRecentCheckResultsForFile

* kick CI

* Allow e2e tests to fail for now

* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240227.2 (#16777)

Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 9.0.0-alpha.1.24123.3 -> To Version 9.0.0-alpha.1.24127.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

---------

Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Co-authored-by: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Co-authored-by: dawe <dawedawe@posteo.de>
Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
@KevinRansom KevinRansom deleted the Fix16105 branch March 21, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Release inline optimization leads to MethodAccessException if used with assembly:InternalsVisibleTo attribute
3 participants