Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

A couple fixes to p/invoke marshalling pregeneration #27286

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

MichalStrehovsky
Copy link
Member

  • Expose the PreserveSig bit on PInvokeMetadata and reject precompiling methods with HResult munging
  • Parse CustomMarshaller records to avoid asserting
  • Place marshalling cleanup in a new cleanup stream that runs in a finally block
  • Place SafeHandle code into the cleanup stream

* Expose the PreserveSig bit on PInvokeMetadata and reject precompiling methods with HResult munging
* Parse CustomMarshaller records to avoid asserting
* Place marshalling cleanup in a new cleanup stream that runs in a finally block
* Place SafeHandle code into the cleanup stream
@MichalStrehovsky
Copy link
Member Author

Cc @sergiy-k

ILCodeStream cleanupCodestream = pInvokeILCodeStreams.CleanupCodeStream;

// Marshalling is wrapped in a finally block to guarantee cleanup
ILExceptionRegionBuilder tryFinally = emitter.NewFinallyRegion();
Copy link
Member Author

Choose a reason for hiding this comment

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

This relies on the codegen to remove empty finally regions. I assume it's fine since RyuJIT does that. I kind of forgot to design the ILExceptionRegionBuilder in a way where we could change our mind about the exception region later...

@jkotas
Copy link
Member

jkotas commented Oct 21, 2019

/azp run coreclr-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants