revert this one, it broke test-68
authorMiguel de Icaza <miguel@gnome.org>
Mon, 19 Jan 2004 16:25:51 +0000 (16:25 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 19 Jan 2004 16:25:51 +0000 (16:25 -0000)
svn path=/trunk/mcs/; revision=22255

mcs/mcs/ecore.cs

index 4589a943f1266d96ba4be116e138aee3b4e3212f..9f2b5218f2cc92fe7395a4237848187f01c40043 100755 (executable)
@@ -2791,23 +2791,12 @@ namespace Mono.CSharp {
                                //
                                if (instance_expr is This)
                                        ((This)instance_expr).AddressOf (ec, AddressOp.LoadStore);
-                               else if (instance_expr.Type.IsValueType){
-                                       if (instance_expr is IMemoryLocation){
-                                               IMemoryLocation ml = (IMemoryLocation) instance_expr;
-
-                                               ml.AddressOf (ec, AddressOp.LoadStore);
-                                       } else {
-                                               instance_expr.Emit (ec);
-                                               LocalBuilder local = ig.DeclareLocal (instance_expr.Type);
-                                               ig.Emit(OpCodes.Stloc, local);
-                                               ig.Emit(OpCodes.Ldloca, local);
-                                               ig.Emit(OpCodes.Ldfld, FieldInfo);
-                                               LocalBuilder local2 = ig.DeclareLocal(type);
-                                               ig.Emit(OpCodes.Stloc, local2);
-                                               ig.Emit(OpCodes.Ldloca, local2);
-                                               return;
-                                       }
-                               }
+                               else if (instance_expr.Type.IsValueType && instance_expr is IMemoryLocation){
+                                       IMemoryLocation ml = (IMemoryLocation) instance_expr;
+
+                                       ml.AddressOf (ec, AddressOp.LoadStore);
+                               } else
+                                       instance_expr.Emit (ec);
                                ig.Emit (OpCodes.Ldflda, FieldInfo);
                        }
                }