* tuner/Mono.Tuner/MoonlightA11yProcessor.cs: Don't whitelist SC
authorAndrés G. Aragoneses <knocte@gmail.com>
Thu, 13 Aug 2009 15:18:12 +0000 (15:18 -0000)
committerAndrés G. Aragoneses <knocte@gmail.com>
Thu, 13 Aug 2009 15:18:12 +0000 (15:18 -0000)
attribs for base methods that are on our assembly.
This finally makes a11y work without security disabled. The summary of
the troubles encountered:
- GetHashCode() -> base method not SC. (r139589+r139649)
- Dispose() -> interface method not SC. (r139796)
- get_Handle() -> interface method SC while impl not SC. (this commit)

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

mcs/tools/tuner/ChangeLog
mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs

index 094d71770637c3c1f3334ecba83ac11a2a334fd0..d3bfcf3d342548c14229af91f9b7e64bf668915b 100644 (file)
@@ -1,3 +1,14 @@
+2009-08-13  Andrés G. Aragoneses  <aaragoneses@novell.com>
+
+       * Mono.Tuner/MoonlightA11yProcessor.cs: Don't whitelist SC
+         attribs for base methods that are on our assembly.
+       This finally makes a11y work without security disabled. The
+         summary of the troubles encountered:
+       - GetHashCode() -> base method not SC. (r139589+r139649)
+       - Dispose() -> interface method not SC. (r139796)
+       - get_Handle() -> interface method SC while impl not SC. (this
+         commit)
+
 2009-08-12  Andrés G. Aragoneses  <aaragoneses@novell.com>
 
        * Mono.Tuner/MoonlightA11yProcessor.cs: Look for base methods
index c2ae8691820252b500c64c792497ef847f5f1674..ad7fe39654813fc50e03c8550dd4b08c1f103f4a 100644 (file)
@@ -101,7 +101,15 @@ namespace Mono.Tuner {
                                                        parent = GetBaseMethod (type, method);
                                                }
 
-                                               if (parent == null || HasSecurityAttribute (parent, AttributeType.Critical))
+                                               //if there's no base method
+                                               if (parent == null ||
+
+                                               //if it's our bridge assembly, we're sure it will (finally, at the end of the linking process) have the SC attrib
+                                                   _assembly.MainModule.Types.Contains (parent.DeclaringType) ||
+
+                                               //if the type is in the moonlight assemblies, check if it has the SC attrib
+                                                   HasSecurityAttribute (parent, AttributeType.Critical))
+
                                                        AddCriticalAttribute (method);
                                }