Author: martin
Date: 2005-04-19 10:52:55 -0400 (Tue, 19 Apr 2005)
New Revision: 43260

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/attribute.cs
   trunk/mcs/gmcs/cs-parser.jay
Log:
**** Merged r42679 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-19 14:51:20 UTC (rev 43259)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-19 14:52:55 UTC (rev 43260)
@@ -1,3 +1,12 @@
+2005-04-08  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #74484.
+       * attribute.cs (Attribute.GetAttributeUsage): Resolve
+       AttributeUsageAttribute in the emitcontext of the attribute class,
+       not in the emitcontext of the attributable entity it was attached to.
+       * cs-parser.jay: Use 'current_class', not 'current_container',
+       when creating a GlobalAttribute.
+
 2005-04-08  Alp Toker  <[EMAIL PROTECTED]>
 
        * pending.cs: The fix to #58413 failed to compile methods implementing

Modified: trunk/mcs/gmcs/attribute.cs
===================================================================
--- trunk/mcs/gmcs/attribute.cs 2005-04-19 14:51:20 UTC (rev 43259)
+++ trunk/mcs/gmcs/attribute.cs 2005-04-19 14:52:55 UTC (rev 43260)
@@ -648,18 +648,14 @@
                                return ua;
                        }
 
-                       if (attr_class.OptAttributes == null) {
-                               usage_attr_cache.Add (Type, 
DefaultUsageAttribute);
-                               return DefaultUsageAttribute;
-                       }
+                       Attribute a = attr_class.OptAttributes == null
+                               ? null
+                               : attr_class.OptAttributes.Search 
(TypeManager.attribute_usage_type, attr_class.EmitContext);
 
-                       Attribute a = attr_class.OptAttributes.Search 
(TypeManager.attribute_usage_type, ec);
-                       if (a == null) {
-                               usage_attr_cache.Add (Type, 
DefaultUsageAttribute);
-                               return DefaultUsageAttribute;
-                       }
+                       ua = a == null
+                               ? DefaultUsageAttribute 
+                               : a.GetAttributeUsageAttribute 
(attr_class.EmitContext);
 
-                       ua = a.GetAttributeUsageAttribute (ec);
                        usage_attr_cache.Add (Type, ua);
                        return ua;
                }

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2005-04-19 14:51:20 UTC (rev 43259)
+++ trunk/mcs/gmcs/cs-parser.jay        2005-04-19 14:52:55 UTC (rev 43260)
@@ -619,7 +619,7 @@
                Expression left_expr = left == null ? null : 
left.GetTypeExpression (loc);
 
                if (current_attr_target == "assembly" || current_attr_target == 
"module")
-                       $$ = new GlobalAttribute (current_container, 
current_attr_target,
+                       $$ = new GlobalAttribute (current_class, 
current_attr_target,
                                                  left_expr, identifier, 
(ArrayList) $3, loc);
                else
                        $$ = new Attribute (current_attr_target, left_expr, 
identifier, (ArrayList) $3, loc);
@@ -5158,6 +5158,8 @@
                if (yacc_verbose_flag > 0)
                        Console.WriteLine (e);
        }
+
+       RootContext.Tree.Types.NamespaceEntry = null;
 }
 
 void CheckToken (int error, int yyToken, string msg)

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

Reply via email to