Skip to content

Rewrite exception handler if retval is a pointer#82740

Merged
jtschuster merged 3 commits into
dotnet:mainfrom
jtschuster:AddCastToExceptionMarshalling2
Feb 28, 2023
Merged

Rewrite exception handler if retval is a pointer#82740
jtschuster merged 3 commits into
dotnet:mainfrom
jtschuster:AddCastToExceptionMarshalling2

Conversation

@jtschuster
Copy link
Copy Markdown
Member

Fixes #82504

We need to cast the IntPtr we assign to __retVal_native when it is a pointer type. This uses the PointerNativeTypeAssignmentRewriter to do this. I left it as a nested class in NonBlittableElementsMarshalling, but let me know if it should be moved out.

@ghost
Copy link
Copy Markdown

ghost commented Feb 27, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #82504

We need to cast the IntPtr we assign to __retVal_native when it is a pointer type. This uses the PointerNativeTypeAssignmentRewriter to do this. I left it as a nested class in NonBlittableElementsMarshalling, but let me know if it should be moved out.

Author: jtschuster
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

Copy link
Copy Markdown
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

One comment. The rest looks good!

@jtschuster jtschuster merged commit a3290ee into dotnet:main Feb 28, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 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.

ComInterfaceGenerator generates code with pointer type in generic

2 participants