Author: spouliot
Date: 2005-03-23 08:16:47 -0500 (Wed, 23 Mar 2005)
New Revision: 42142

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/declsec.c
Log:
2005-03-23  Sebastien Pouliot  <[EMAIL PROTECTED]>
        * declsec.c: Skip linkdemand checks for intra-corlib calls. This skips
        a lot of checks and (anyway) permissions cannot work until corlib is 
        loaded.



Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-03-23 13:14:41 UTC (rev 42141)
+++ trunk/mono/mono/mini/ChangeLog      2005-03-23 13:16:47 UTC (rev 42142)
@@ -1,4 +1,9 @@
+2005-03-23  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
+       * declsec.c: Skip linkdemand checks for intra-corlib calls. This skips
+       a lot of checks and (anyway) permissions cannot work until corlib is 
+       loaded.
+
 Wed Mar 23 14:29:49 CET 2005 Paolo Molaro <[EMAIL PROTECTED]>
 
        * mini-ppc.c: fixed ABI issue on sysv/ppc.

Modified: trunk/mono/mono/mini/declsec.c
===================================================================
--- trunk/mono/mono/mini/declsec.c      2005-03-23 13:14:41 UTC (rev 42141)
+++ trunk/mono/mono/mini/declsec.c      2005-03-23 13:16:47 UTC (rev 42142)
@@ -356,8 +356,14 @@
 mono_declsec_linkdemand (MonoDomain *domain, MonoMethod *caller, MonoMethod 
*callee)
 {
        guint32 violation = MONO_JIT_SECURITY_OK;
-       /* first, the special (implied) linkdemand */
 
+       /* short-circuit corlib as it is fully trusted (within itself)
+        * and because this cause major recursion headaches */
+       if ((caller->klass->image == mono_defaults.corlib) && 
(callee->klass->image == mono_defaults.corlib))
+               return violation;
+
+       /* next, the special (implied) linkdemand */
+
        if (callee->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
                /* restrict internal calls into the runtime */
                if (mono_declsec_linkdemand_icall (domain, caller, callee))

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

Reply via email to