Browse Source

* MessageFormatter.cs: Fixed bug in serialization of arguments.
* ObjectReader.cs: Fixed bug causing array of structs to fail.

svn path=/trunk/mcs/; revision=11661

Lluis Sanchez 23 years ago
parent
commit
032fcf581e

+ 5 - 0
mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog

@@ -1,3 +1,8 @@
+2003-02-04  Lluis Sanchez Gual <[email protected]>
+
+    * MessageFormatter.cs: Fixed bug in serialization of arguments.
+    * ObjectReader.cs: Fixed bug causing array of structs to fail.
+
 2003-02-11  Patrik Torstensson
 
     * ObjectReader.cs: Fixed root object bug causing object reader to return root object 

+ 1 - 1
mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs

@@ -48,7 +48,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
 				infoArraySize++;
 			}
 
-			if (call.InArgCount == 0)
+			if (call.ArgCount == 0)
 				methodFlags |= MethodFlags.NoArguments;
 			else {
 				if (AllTypesArePrimitive (call.Args)) 

+ 6 - 1
mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs

@@ -222,10 +222,15 @@ namespace System.Runtime.Serialization.Formatters.Binary
 
 		private void RegisterObject (long objectId, object objectInstance, SerializationInfo info, long parentObjectId, MemberInfo parentObjectMemeber, int[] indices)
 		{
+			if (parentObjectId == 0) indices = null;
+
 			if (!objectInstance.GetType().IsValueType || parentObjectId == 0)
-				_manager.RegisterObject (objectInstance, objectId, info, 0, null, indices);
+				_manager.RegisterObject (objectInstance, objectId, info, 0, null, null);
 			else
+			{
+				if (indices != null) indices = (int[])indices.Clone();
 				_manager.RegisterObject (objectInstance, objectId, info, parentObjectId, parentObjectMemeber, indices);
+			}
 		}
 
 		private void ReadStringIntance (BinaryReader reader, out long objectId, out object value)