Author: martin
Date: 2006-06-21 16:32:20 -0400 (Wed, 21 Jun 2006)
New Revision: 61915

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/ecore.cs
Log:
2006-06-21  Martin Baulig  <[EMAIL PROTECTED]>

        * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
        handle SetAssigned() and SetMemberIsUsed() for generic types;
        fixes #77545.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2006-06-21 20:08:38 UTC (rev 61914)
+++ trunk/mcs/gmcs/ChangeLog    2006-06-21 20:32:20 UTC (rev 61915)
@@ -1,5 +1,11 @@
 2006-06-21  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
+       handle SetAssigned() and SetMemberIsUsed() for generic types;
+       fixes #77545.
+
+2006-06-21  Martin Baulig  <[EMAIL PROTECTED]>
+
        * delegate.cs
        (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
 

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2006-06-21 20:08:38 UTC (rev 61914)
+++ trunk/mcs/gmcs/ecore.cs     2006-06-21 20:32:20 UTC (rev 61915)
@@ -3341,15 +3341,13 @@
                                }
                        }
 
-                       if (FieldInfo is FieldBuilder){
-                               FieldBase f = TypeManager.GetField (FieldInfo);
-                               if (f != null){
-                                       if ((f.ModFlags & Modifiers.VOLATILE) 
!= 0)
-                                               ig.Emit (OpCodes.Volatile);
+                       FieldBase f = TypeManager.GetField (FieldInfo);
+                       if (f != null){
+                               if ((f.ModFlags & Modifiers.VOLATILE) != 0)
+                                       ig.Emit (OpCodes.Volatile);
                                        
-                                       f.SetAssigned ();
-                               }
-                       } 
+                               f.SetAssigned ();
+                       }
 
                        if (is_static)
                                ig.Emit (OpCodes.Stsfld, FieldInfo);
@@ -3368,22 +3366,20 @@
                public void AddressOf (EmitContext ec, AddressOp mode)
                {
                        ILGenerator ig = ec.ig;
-                       
-                       if (FieldInfo is FieldBuilder){
-                               FieldBase f = TypeManager.GetField (FieldInfo);
-                               if (f != null){
-                                       if ((f.ModFlags & Modifiers.VOLATILE) 
!= 0){
-                                               Report.Warning (420, 1, loc, 
"`{0}': A volatile fields cannot be passed using a ref or out parameter",
+
+                       FieldBase f = TypeManager.GetField (FieldInfo);
+                       if (f != null){
+                               if ((f.ModFlags & Modifiers.VOLATILE) != 0){
+                                       Report.Warning (420, 1, loc, "`{0}': A 
volatile fields cannot be passed using a ref or out parameter",
                                                        f.GetSignatureForError 
());
-                                               return;
-                                       }
-                                       
-                                       if ((mode & AddressOp.Store) != 0)
-                                               f.SetAssigned ();
-                                       if ((mode & AddressOp.Load) != 0)
-                                               f.SetMemberIsUsed ();
+                                       return;
                                }
-                       } 
+                                       
+                               if ((mode & AddressOp.Store) != 0)
+                                       f.SetAssigned ();
+                               if ((mode & AddressOp.Load) != 0)
+                                       f.SetMemberIsUsed ();
+                       }
 
                        //
                        // Handle initonly fields specially: make a copy and 
then

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to