Author: jbevain
Date: 2006-08-21 06:39:50 -0400 (Mon, 21 Aug 2006)
New Revision: 64137
Modified:
trunk/cecil/linker/Mono.Linker/AssemblyMarker.cs
Log:
correct how the parameters are compared
Modified: trunk/cecil/linker/Mono.Linker/AssemblyMarker.cs
===================================================================
--- trunk/cecil/linker/Mono.Linker/AssemblyMarker.cs 2006-08-21 10:25:57 UTC
(rev 64136)
+++ trunk/cecil/linker/Mono.Linker/AssemblyMarker.cs 2006-08-21 10:39:50 UTC
(rev 64137)
@@ -118,24 +118,35 @@
if (meth.Name != reference.Name)
continue;
- if (meth.Parameters.Count !=
reference.Parameters.Count)
+ if (!AreSame (meth.ReturnType.ReturnType,
reference.ReturnType.ReturnType))
continue;
- if (!AreSame (meth.ReturnType.ReturnType,
reference.ReturnType.ReturnType))
+ if (!AreSame (meth.Parameters,
reference.Parameters))
continue;
- for (int i = 0; i < meth.Parameters.Count; i++)
- if (!AreSame (meth.Parameters
[i].ParameterType, reference.Parameters [i].ParameterType))
- continue;
-
return meth;
}
return null;
}
- bool AreSame (TypeReference a, TypeReference b)
+ bool AreSame (ParameterDefinitionCollection a,
ParameterDefinitionCollection b)
{
+ if (a.Count != b.Count)
+ return false;
+
+ if (a.Count == 0)
+ return true;
+
+ for (int i = 0; i < a.Count; i++)
+ if (!AreSame (a [i].ParameterType, b
[i].ParameterType))
+ return false;
+
+ return true;
+ }
+
+ bool AreSame(TypeReference a, TypeReference b)
+ {
if (a is TypeSpecification || b is TypeSpecification) {
if (a.GetType () != b.GetType ())
return false;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches