-
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
Check if the marshalling of a field is possible across all platforms. #53194
Conversation
@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. |
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. |
This comment has been minimized.
This comment has been minimized.
if (info.GetMarshalType() == MarshalInfo::MARSHAL_TYPE_UNKNOWN) | ||
info.ThrowTypeLoadExceptionForInvalidFieldMarshal(pFD, info.GetErrorResourceId()); |
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.
Do we have a test for the failure case?
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.