Author: jbevain
Date: 2007-07-19 10:52:35 -0400 (Thu, 19 Jul 2007)
New Revision: 82290
Modified:
trunk/mcs/class/Mono.Cecil/ChangeLog
trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeReader.cs
trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs
trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs
Log:
2007-07-19 Jb Evain <[EMAIL PROTECTED]>
* Mono.Cecil/ReflectionReader.cs
Mono.Cecil.Cil/CodeReader.cs
Mono.Cecil.Signature/SignatureReader.cs:
Better handling of the sentil in the varargs methods.
Modified: trunk/mcs/class/Mono.Cecil/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Cecil/ChangeLog 2007-07-19 14:16:04 UTC (rev
82289)
+++ trunk/mcs/class/Mono.Cecil/ChangeLog 2007-07-19 14:52:35 UTC (rev
82290)
@@ -1,6 +1,11 @@
2007-07-19 Jb Evain <[EMAIL PROTECTED]>
* Mono.Cecil/ReflectionReader.cs
+ Mono.Cecil.Cil/CodeReader.cs
+ Mono.Cecil.Signature/SignatureReader.cs:
+ Better handling of the sentil in the varargs methods.
+
+ * Mono.Cecil/ReflectionReader.cs
Mono.Cecil/SentinelType.cs
Mono.Cecil.Cil/CodeWriter.cs:
Mono.Cecil.Signatures/SignatureReader.cs:
Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs 2007-07-19
14:16:04 UTC (rev 82289)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/ReflectionReader.cs 2007-07-19
14:52:35 UTC (rev 82290)
@@ -234,10 +234,6 @@
methref.Parameters.Add (pdef);
}
- MethodDefSig mdsig = ms as MethodDefSig;
- if (mdsig != null && mdsig.Sentinel >
-1)
- CreateSentinel (methref,
mdsig.Sentinel);
-
member = methref;
}
break;
@@ -1020,10 +1016,6 @@
p, context));
}
- MethodRefSig refSig = funcptr.Method as
MethodRefSig;
- if (refSig != null && refSig.Sentinel >= 0)
- CreateSentinel (fnptr, refSig.Sentinel);
-
return fnptr;
case ElementType.Var:
VAR var = t as VAR;
@@ -1050,21 +1042,14 @@
ginst.Signature.Types [i],
context));
return instance;
+ case ElementType.Sentinel:
+ return new SentinelType ();
default:
break;
}
return null;
}
- public static void CreateSentinel (IMethodSignature meth, int
sentinel)
- {
- if (sentinel < 0 || sentinel >= meth.Parameters.Count)
- throw new ArgumentException ("Invalid
sentinel");
-
- ParameterDefinition param = meth.Parameters [sentinel];
- param.ParameterType = new SentinelType ();
- }
-
TypeReference GetGenericArg (GenericArg arg, GenericContext
context)
{
TypeReference type = GetTypeRefFromSig (arg.Type,
context);
Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeReader.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeReader.cs 2007-07-19
14:16:04 UTC (rev 82289)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CodeReader.cs 2007-07-19
14:52:35 UTC (rev 82290)
@@ -331,10 +331,6 @@
p, context));
}
- MethodRefSig refSig = ms as MethodRefSig;
- if (refSig != null && refSig.Sentinel >= 0)
- ReflectionReader.CreateSentinel (cs,
refSig.Sentinel);
-
return cs;
}
Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs
===================================================================
--- trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs
2007-07-19 14:16:04 UTC (rev 82289)
+++ trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs
2007-07-19 14:52:35 UTC (rev 82290)
@@ -401,7 +401,7 @@
int curs = start;
int flag = Utilities.ReadCompressedInteger
(data, start, out start);
- if ((flag & (int) ElementType.Sentinel) != 0)
+ if (flag == (int) ElementType.Sentinel)
sentinelpos = i;
ret [i] = ReadParameter (data, curs, out start);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches