Sfoglia il codice sorgente

2008-02-05 Jb Evain <[email protected]>

	* Mono.Cecil.Signatures/SignatureReader.cs:
		Properly read fnptr local variables. Fix #358507.

svn path=/trunk/mcs/; revision=94868
Jb Evain 18 anni fa
parent
commit
da17893333

+ 3 - 0
mcs/class/Mono.Cecil/ChangeLog

@@ -1,5 +1,8 @@
 2008-02-05  Jb Evain  <[email protected]>
 
+	* Mono.Cecil.Signatures/SignatureReader.cs:
+		Properly read fnptr local variables. Fix #358507.
+
 	* Mono.Cecil.Binary/DefaultImporter.cs:
 		Import modifiers and sentinels, patch from:
 		Andrea Carlo Ornstein <[email protected]>

+ 7 - 7
mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs

@@ -237,7 +237,7 @@ namespace Mono.Cecil.Signatures {
 			property.ParamCount = Utilities.ReadCompressedInteger (m_blobData, start + 1, out start);
 			property.CustomMods = ReadCustomMods (m_blobData, start, out start);
 			property.Type = ReadType (m_blobData, start, out start);
-			property.Parameters = ReadParameters (property.ParamCount, m_blobData, start);
+			property.Parameters = ReadParameters (property.ParamCount, m_blobData, start, out start);
 		}
 
 		public override void VisitLocalVarSig (LocalVarSig localvar)
@@ -267,7 +267,7 @@ namespace Mono.Cecil.Signatures {
 			methodDef.ParamCount = Utilities.ReadCompressedInteger (data, start, out start);
 			methodDef.RetType = ReadRetType (data, start, out start);
 			int sentpos;
-			methodDef.Parameters = ReadParameters (methodDef.ParamCount, data, start, out sentpos);
+			methodDef.Parameters = ReadParameters (methodDef.ParamCount, data, start, out start, out sentpos);
 			methodDef.Sentinel = sentpos;
 		}
 
@@ -292,7 +292,7 @@ namespace Mono.Cecil.Signatures {
 			methodRef.ParamCount = Utilities.ReadCompressedInteger (data, start, out start);
 			methodRef.RetType = ReadRetType (data, start, out start);
 			int sentpos;
-			methodRef.Parameters = ReadParameters (methodRef.ParamCount, data, start, out sentpos);
+			methodRef.Parameters = ReadParameters (methodRef.ParamCount, data, start, out start, out sentpos);
 			methodRef.Sentinel = sentpos;
 		}
 
@@ -384,19 +384,19 @@ namespace Mono.Cecil.Signatures {
 			return rt;
 		}
 
-		Param [] ReadParameters (int length, byte [] data, int pos)
+		Param [] ReadParameters (int length, byte [] data, int pos, out int start)
 		{
 			Param [] ret = new Param [length];
-			int start = pos;
+			start = pos;
 			for (int i = 0; i < length; i++)
 				ret [i] = ReadParameter (data, start, out start);
 			return ret;
 		}
 
-		Param [] ReadParameters (int length, byte [] data, int pos, out int sentinelpos)
+		Param [] ReadParameters (int length, byte [] data, int pos, out int start, out int sentinelpos)
 		{
 			Param [] ret = new Param [length];
-			int start = pos;
+			start = pos;
 			sentinelpos = -1;
 
 			for (int i = 0; i < length; i++) {