2002-07-19 Martin Baulig <martin@gnome.org>
authorMartin Baulig <martin@novell.com>
Fri, 19 Jul 2002 14:28:45 +0000 (14:28 -0000)
committerMartin Baulig <martin@novell.com>
Fri, 19 Jul 2002 14:28:45 +0000 (14:28 -0000)
* expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
not Type.GetType() to lookup the array type.  This is needed when
we're constructing an array of a user-defined type.
(ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
single-dimensional arrays, but also for single-dimensial arrays of
type decimal.

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

mcs/mcs/ChangeLog
mcs/mcs/expression.cs

index 82d24154e0c75b588fccafab1701c18555c22bde..e5b130f5bf8d0ca995eaf8dd7847a9427fb10471 100755 (executable)
@@ -1,3 +1,12 @@
+2002-07-19  Martin Baulig  <martin@gnome.org>
+
+       * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
+       not Type.GetType() to lookup the array type.  This is needed when
+       we're constructing an array of a user-defined type.
+       (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
+       single-dimensional arrays, but also for single-dimensial arrays of
+       type decimal.
+
 2002-07-19  Martin Baulig  <martin@gnome.org>
 
        * expression.cs (New.DoEmit): Create a new LocalTemporary each time
index f021a6bae8803a6df6d855ceabe9d34ccc1b0fbb..14f9e7f907540d350cf2d4f28e4b023b4eb72fd1 100755 (executable)
@@ -3750,7 +3750,7 @@ namespace Mono.CSharp {
                        string array_type = t.FullName + "[]";
                        LocalBuilder array;
 
-                       array = ig.DeclareLocal (Type.GetType (array_type));
+                       array = ig.DeclareLocal (TypeManager.LookupType (array_type));
                        IntConstant.EmitInt (ig, count);
                        ig.Emit (OpCodes.Newarr, TypeManager.TypeToCoreType (t));
                        ig.Emit (OpCodes.Stloc, array);
@@ -4522,7 +4522,7 @@ namespace Mono.CSharp {
                        }
 
                        is_builtin_type = TypeManager.IsBuiltinType (type);
-                       
+
                        if (is_builtin_type) {
                                Expression ml;
                                
@@ -4789,8 +4789,10 @@ namespace Mono.CSharp {
                                                // If we are dealing with a struct, get the
                                                // address of it, so we can store it.
                                                //
-                                               if (etype.IsSubclassOf (TypeManager.value_type) &&
-                                                   !TypeManager.IsBuiltinType (etype)){
+                                               if ((dims == 1) &&
+                                                   etype.IsSubclassOf (TypeManager.value_type) &&
+                                                   (!TypeManager.IsBuiltinType (etype) ||
+                                                    etype == TypeManager.decimal_type)) {
                                                        if (e is New){
                                                                New n = (New) e;
 
@@ -4803,7 +4805,7 @@ namespace Mono.CSharp {
                                                                             
                                                        ig.Emit (OpCodes.Ldelema, etype);
                                                }
-                                                   
+
                                                e.Emit (ec);
                                                
                                                if (dims == 1)