-
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
PersistedAssemblyBuilder: fix IL reference tokens to another generated assembly members #107661
Conversation
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.
Thank you!
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10815345665 |
Thanks! Will this be in the daily builds? Edit: I see I have to look for the commits of the 'rolling' builds. Seems runtime is a day or 2 behind, but will look for when it comes. |
I don't see it made to daily build yet https://github.com/dotnet/sdk/blob/main/documentation/package-table.md |
Arrived with 9.0.100-rc.2.24463.1. Hoping there is no more issues! Update: No other issues detected, all persisted dll's passes IL verify checks. |
Good news! Successfully compiled all 234 libraries I have in IronScheme. Thanks a lot for your work on this, my 5 users will be ecstatic! Nice speed bump too compared to .NET 2 x86! .NET 2 x86
.NET 9
|
Great to hear @leppie, thank you for giving it try and reporting issues found! |
Pleasure. IronScheme tends to break things, so a pretty good coverage test. It is a single assembly that run on any .NET 2 onwards basically (MS or Mono). There is a very small PAL that is loaded dynamically from embedded resources. If the platform can run dotnet, it can run IronScheme. I have even ran it on my TV. Persisted compilation will just make it a lot faster for limited platforms, instead of relying on the incremental (runtime) compiler. |
A generated assembly member tokens will not populated properly until its saved. Therefore we reserve Blob for such tokens and fill-in during
assembly.Save()
operation. As per this design current code reserves tokens in case the IL referencing TypeBuilder, FieldBuilder, MethodBuilder, ConstructorBuilder or generic type parameter references TypeBuilder. This caused a bug when members are refenced from another generated assembly, tokens are reserved as it was in the same assembly instead it should have reference tokens to that assemblyThe fix basically involves checking if the referenced member is in a same module, that is pretty much adding another check
&& Equals(member.Module)
and make the static methods instance in order to use theEquals(object)
instance method of the moduleFixes #107658