-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make it possible to preinitialize ComInterfaceEntry
#114459
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
Conversation
Fixes dotnet#114355. Special case `ComWrappers.ComInterfaceEntry` and types that only consist of these fields to achieve this.
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs:2705
- In the Clone method of VTableLikeStructValue (line 2705), passing null for fieldThatOwnsMemory may cause loss of necessary context. Consider preserving the existing fieldThatOwnsMemory if applicable.
return new VTableLikeStructValue(_type, (MethodDesc[])_methods.Clone(), fieldThatOwnsMemory: null);
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs:2727
- The MemoryOwner property in VTableLikeSlotReferenceValue returns a non-null value only when _index is 0. Verify that this behavior is intentional for all indices.
public override FieldDesc MemoryOwner => _index == 0 ? _fieldThatOwnsMemory : null;
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs:2491
- In the IsCompatible method of ComInterfaceEntryArrayValue, entryType is overwritten for each non-static field without verifying that all fields share the same ComInterfaceEntry type. Consider adding an explicit check to ensure consistency across all instance fields.
foreach (FieldDesc field in type.GetFields()) { ... entryType = field.FieldType; ... }
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Fixes #114355.
Special case
ComWrappers.ComInterfaceEntry
and types that only consist of these fields to achieve this.Cc @dotnet/ilc-contrib @Sergio0694