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

Check if the marshalling of a field is possible across all platforms. #53194

Merged
merged 5 commits into from
Jun 8, 2021

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented May 24, 2021

Fixes #53110

The x86 code path for field marshalling required inspection of the field earlier than the amd64 code path. This update makes that inspection occur at the same time in both cases. However, the only real change here is that both will fail later on if the field is attempted to be marshalled via the IClassX interface. The entire experience here is poor though.

@AaronRobinsonMSFT
Copy link
Member Author

@jkoritzinsky and @elinor-fung This is a draft PR to see what people think of the fix. It basically makes the x86 and amd64 logic consistent but it is still poor. We also need a test here.

@jkoritzinsky
Copy link
Member

I'd be ok doing the validation like this.

Personally, I wish we didn't need to support IClassX-style interface generation at all (especially since tlbexp isn't supported), but there's not much we can do about that.

@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review May 27, 2021 23:23
@AaronRobinsonMSFT
Copy link
Member Author

/cc @jkoritzinsky @elinor-fung

@AaronRobinsonMSFT

This comment has been minimized.

@runfoapp runfoapp bot mentioned this pull request May 28, 2021
Comment on lines +1032 to +1033
if (info.GetMarshalType() == MarshalInfo::MARSHAL_TYPE_UNKNOWN)
info.ThrowTypeLoadExceptionForInvalidFieldMarshal(pFD, info.GetErrorResourceId());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test for the failure case?

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit aa558fa into dotnet:main Jun 8, 2021
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the runtime53110 branch June 8, 2021 17:46
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2021
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.

AF: (SIZE_T)mtype < COUNTOF(nativeSizes) when building COM vtable
3 participants