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:
Diffstat (limited to 'src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs')
-rw-r--r--src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs b/src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
index 990433113..d9c937f05 100644
--- a/src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
+++ b/src/Common/src/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
@@ -12,9 +12,9 @@ namespace Internal.IL.Stubs
// Functionality related to determinstic ordering of types
partial class DynamicInvokeMethodThunk
{
- protected override int ClassCode => -1980933220;
+ protected internal override int ClassCode => -1980933220;
- protected override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer)
+ protected internal override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer)
{
return CompareTo((DynamicInvokeMethodThunk)other);
}
@@ -25,13 +25,23 @@ namespace Internal.IL.Stubs
if (result != 0)
return result;
- result = (_targetSignature.HasReturnValue ? 1 : 0) - (otherMethod._targetSignature.HasReturnValue ? 1 : 0);
+ DynamicInvokeMethodParameterKind thisReturnType = _targetSignature.ReturnType;
+ result = (int)thisReturnType - (int)otherMethod._targetSignature.ReturnType;
+ if (result != 0)
+ return result;
+
+ result = _targetSignature.GetNumerOfReturnTypePointerIndirections() - otherMethod._targetSignature.GetNumerOfReturnTypePointerIndirections();
if (result != 0)
return result;
for (int i = 0; i < _targetSignature.Length; i++)
{
- result = (int)_targetSignature[i] - (int)otherMethod._targetSignature[i];
+ DynamicInvokeMethodParameterKind thisParamType = _targetSignature[i];
+ result = (int)thisParamType - (int)otherMethod._targetSignature[i];
+ if (result != 0)
+ return result;
+
+ result = _targetSignature.GetNumberOfParameterPointerIndirections(i) - otherMethod._targetSignature.GetNumberOfParameterPointerIndirections(i);
if (result != 0)
return result;
}
@@ -42,9 +52,9 @@ namespace Internal.IL.Stubs
partial class DynamicInvokeThunkGenericParameter
{
- protected override int ClassCode => -234393261;
+ protected internal override int ClassCode => -234393261;
- protected override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
+ protected internal override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
{
var otherType = (DynamicInvokeThunkGenericParameter)other;
int result = Index - otherType.Index;
@@ -55,4 +65,4 @@ namespace Internal.IL.Stubs
}
}
}
-} \ No newline at end of file
+}