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

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFadi Hanna <fadim@microsoft.com>2017-07-12 03:37:03 +0300
committerFadi Hanna <fadim@microsoft.com>2017-07-12 03:37:03 +0300
commitec0d6556b34fd8afa1c68948313b4b2b7205a4bc (patch)
tree4a02a9df35d249493ce9898890c81b7225976e59 /src/System.Private.Reflection.Execution
parente9f805611344055538df1054540c6c4d4d814e93 (diff)
Fix for 462734
DelegateMethodInfoRetriever.GetDelegateMethodInfo was recently changed to throw MissingRuntimeArtifactException instead of returning null. This caused one of the DG test to fail, and uncovered an actual real bug. The test was performing delegate.GetMethodInfo() calls, and asserting that 2 delegates constructed in different ways were returning the same MethodInfo. The test was passing for the wrong reason: because null == null is true :). The test needed some rd.xml entries to make the delegate's target method reflectable in order to get a valid MethodInfo. In the USG case, delegate targets could be wrapped inside call converter thunks, which wasn't detected/handled correctly by the logic in TryGetMethodForOriginalLdFtnResult. [tfs-changeset: 1665453]
Diffstat (limited to 'src/System.Private.Reflection.Execution')
-rw-r--r--src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
index 15db12b2c..2ebe05212 100644
--- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
+++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
@@ -935,8 +935,12 @@ namespace Internal.Reflection.Execution
}
else
{
- canonOriginalLdFtnResult = RuntimeAugments.GetCodeTarget(originalLdFtnResult);
- instantiationArgument = IntPtr.Zero;
+ // The thunk could have been created by the TypeLoader as a dictionary slot for USG code
+ if (!CallConverterThunk.TryGetCallConversionTargetPointerAndInstantiatingArg(originalLdFtnResult, out canonOriginalLdFtnResult, out instantiationArgument))
+ {
+ canonOriginalLdFtnResult = RuntimeAugments.GetCodeTarget(originalLdFtnResult);
+ instantiationArgument = IntPtr.Zero;
+ }
}
}