Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs')
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
index 57f724815fb..b1bbb25130f 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
@@ -345,6 +345,13 @@ namespace Internal.IL.Stubs
InteropTypes.GetPInvokeMarshal(context)
.GetKnownMethod("SaveLastError", null)));
}
+
+ if (MarshalHelpers.ShouldCheckForPendingException(context.Target, _pInvokeMetadata))
+ {
+ MetadataType lazyHelperType = context.SystemModule.GetKnownType("System.Runtime.InteropServices.ObjectiveC", "ObjectiveCMarshal");
+ callsiteSetupCodeStream.Emit(ILOpcode.call, emitter.NewToken(lazyHelperType
+ .GetKnownMethod("ThrowPendingExceptionObject", null)));
+ }
}
private void EmitCalli(PInvokeILCodeStreams ilCodeStreams, CalliMarshallingMethodThunk calliThunk)