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 creation of pointer arrays #79433

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

MichalStrehovsky
Copy link
Member

Creation of pointer arrays is on a similar plan to multi-dim arrays - we create them from a template type, but the template is slightly off. Previously, EETypeCreator would massage the bits into the correct shape, but now we mostly just copy the bits from the template. Use a more precise template for pointer arrays.

Without this, the base size and element type of pointer arrays was slightly wrong.

I'm also deleting the duplicated "use a special template for this one" logic.

This should fix #79403 (it didn't repro for me locally, but I didn't try too hard because I just followed a hunch and saw the MethodTable being wrong).

Cc @dotnet/ilc-contrib

Creation of pointer arrays is on a similar plan to multi-dim arrays - we create them from a template type, but the template is slightly wrong. Previously, EETypeCreator would massage the bits into the correct shape, but now we mostly just copy the bits from the template. Use a more precise template for pointer arrays.

Without this, the base size and element type of pointer arrays was slightly wrong.

I'm also deleting the duplicated "use a special template for this one" logic.
@ghost
Copy link

ghost commented Dec 9, 2022

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Creation of pointer arrays is on a similar plan to multi-dim arrays - we create them from a template type, but the template is slightly off. Previously, EETypeCreator would massage the bits into the correct shape, but now we mostly just copy the bits from the template. Use a more precise template for pointer arrays.

Without this, the base size and element type of pointer arrays was slightly wrong.

I'm also deleting the duplicated "use a special template for this one" logic.

This should fix #79403 (it didn't repro for me locally, but I didn't try too hard because I just followed a hunch and saw the MethodTable being wrong).

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@MichalStrehovsky MichalStrehovsky merged commit 8199d0a into dotnet:main Dec 9, 2022
@MichalStrehovsky MichalStrehovsky deleted the ptrarray branch December 9, 2022 09:16
@ghost ghost locked as resolved and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Tests.ArrayTests.CreateInstance test failing in NativeAOT
2 participants