-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[mono] Initialize module's image ALC for dynamic objects #90731
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
[mono] Initialize module's image ALC for dynamic objects #90731
Conversation
Maybe we should set the alc of the dynamic images instead ? |
During initialization, the ALC is set in runtime/src/mono/mono/metadata/sre.c Line 1265 in 82fdd0b
When retrieving custom attributes in |
I wonder if this is because dynamic assemblies have two images - one for the assembly, and one for the image. (this is some old legacy stuff from how the SRE api works). Maybe only the assembly image has an ALC set, but the module image does not? I think the emitted class gets assigned to the module image. |
Thanks for pointing out, the module's image ALC wasn't set. Is there anything we can do to retrieve the image from the assembly, instead of creating a new one for the module? |
I haven't thought about it on a while, but I think I convinced myself that it's a consequence of how the SRE public API works and there's no way to avoid it without a bunch of hacks. But maybe it's with another look |
why this pr not merged to release/8.0? |
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5935192228 |
This PR initializes module's image ALC for dynamic objects created during the runtime.
Fixes #90164