Author: massi
Date: 2006-06-08 16:49:05 -0400 (Thu, 08 Jun 2006)
New Revision: 61586

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini.c
Log:
        * mini.c: Fixed bug 77996, and settled some debugging code.



Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2006-06-08 20:38:11 UTC (rev 61585)
+++ trunk/mono/mono/mini/ChangeLog      2006-06-08 20:49:05 UTC (rev 61586)
@@ -1,3 +1,7 @@
+2006-06-08  Massimiliano Mantione  <[EMAIL PROTECTED]>
+
+       * mini.c: Fixed bug 77996, and settled some debugging code.
+
 2006-06-08  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mini-amd64.c (mono_arch_output_basic_block): Fix a wrong reg-reg move 

Modified: trunk/mono/mono/mini/mini.c
===================================================================
--- trunk/mono/mono/mini/mini.c 2006-06-08 20:38:11 UTC (rev 61585)
+++ trunk/mono/mono/mini/mini.c 2006-06-08 20:49:05 UTC (rev 61586)
@@ -3215,8 +3215,8 @@
                sp++;
        }
 }
-#define MONO_INLINE_CALLED_LIMITED_METHODS 1
-#define MONO_INLINE_CALLER_LIMITED_METHODS 1
+#define MONO_INLINE_CALLED_LIMITED_METHODS 0
+#define MONO_INLINE_CALLER_LIMITED_METHODS 0
 
 #if (MONO_INLINE_CALLED_LIMITED_METHODS)
 static char*
@@ -3532,12 +3532,22 @@
        return klass;
 }
 
+/*
+ * Returns TRUE if the JIT should abort inlining because "callee"
+ * is influenced by security attributes.
+ */
 static
-void check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod 
*callee, MonoBasicBlock *bblock, unsigned char *ip)
+gboolean check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod 
*callee, MonoBasicBlock *bblock, unsigned char *ip)
 {
-       guint32 result = mono_declsec_linkdemand (cfg->domain, caller, callee);
+       guint32 result;
+       
+       if ((cfg->method != caller) && mono_method_has_declsec (callee)) {
+               return TRUE;
+       }
+       
+       result = mono_declsec_linkdemand (cfg->domain, caller, callee);
        if (result == MONO_JIT_SECURITY_OK)
-               return;
+               return FALSE;
 
        if (result == MONO_JIT_LINKDEMAND_ECMA) {
                /* Generate code to throw a SecurityException before the actual 
call/link */
@@ -3556,6 +3566,8 @@
                cfg->exception_type = MONO_EXCEPTION_SECURITY_LINKDEMAND;
                cfg->exception_data = result;
        }
+       
+       return FALSE;
 }
 
 static gboolean
@@ -4329,7 +4341,8 @@
                                goto load_error;
 
                        if (mono_use_security_manager) {
-                               check_linkdemand (cfg, method, cmethod, bblock, 
ip);
+                               if (check_linkdemand (cfg, method, cmethod, 
bblock, ip))
+                                       INLINE_FAILURE;
                        }
 
                        ins->inst_p0 = cmethod;
@@ -4395,7 +4408,8 @@
                                n = fsig->param_count + fsig->hasthis;
 
                                if (mono_use_security_manager) {
-                                       check_linkdemand (cfg, method, cmethod, 
bblock, ip);
+                                       if (check_linkdemand (cfg, method, 
cmethod, bblock, ip))
+                                               INLINE_FAILURE;
                                }
 
                                if (cmethod->iflags & 
METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL &&
@@ -5309,7 +5323,8 @@
                                goto load_error;
 
                        if (mono_use_security_manager) {
-                               check_linkdemand (cfg, method, cmethod, bblock, 
ip);
+                               if (check_linkdemand (cfg, method, cmethod, 
bblock, ip))
+                                       INLINE_FAILURE;
                        }
 
                        n = fsig->param_count;
@@ -6881,7 +6896,8 @@
                                mono_class_init (cmethod->klass);
 
                                if (mono_use_security_manager) {
-                                       check_linkdemand (cfg, method, cmethod, 
bblock, ip);
+                                       if (check_linkdemand (cfg, method, 
cmethod, bblock, ip))
+                                               INLINE_FAILURE;
                                }
 
                                handle_loaded_temps (cfg, bblock, stack_start, 
sp);
@@ -6911,7 +6927,8 @@
                                mono_class_init (cmethod->klass);
 
                                if (mono_use_security_manager) {
-                                       check_linkdemand (cfg, method, cmethod, 
bblock, ip);
+                                       if (check_linkdemand (cfg, method, 
cmethod, bblock, ip))
+                                               INLINE_FAILURE;
                                }
 
                                handle_loaded_temps (cfg, bblock, stack_start, 
sp);
@@ -9871,6 +9888,12 @@
        if (parts == 3)
                return cfg;
 
+       if (cfg->verbose_level > 4) {
+               printf ("BEFORE DECOMPSE START\n");
+               mono_print_code (cfg);
+               printf ("BEFORE DECOMPSE END\n");
+       }
+       
        decompose_pass (cfg);
 
        if (cfg->got_var) {

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

Reply via email to