Author: kumpera
Date: 2007-10-10 11:00:25 -0400 (Wed, 10 Oct 2007)
New Revision: 87271

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/verify.c
Log:
2007-10-10  Rodrigo Kumpera  <[EMAIL PROTECTED]>

        * verify.c (do_invoke_method): handle typedbyref params
        correctly and check for unverifiable return values.

        * verify.c (do_newobj): fix a warning.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-10-10 14:53:13 UTC (rev 87270)
+++ trunk/mono/mono/metadata/ChangeLog  2007-10-10 15:00:25 UTC (rev 87271)
@@ -1,3 +1,10 @@
+2007-10-10  Rodrigo Kumpera  <[EMAIL PROTECTED]>
+
+       * verify.c (do_invoke_method): handle typedbyref params
+       correctly and check for unverifiable return values.
+
+       * verify.c (do_newobj): fix a warning.
+
 2007-10-09  Rodrigo Kumpera  <[EMAIL PROTECTED]>
 
        * verify.c: don't tread typedbyref as allways unverifable,

Modified: trunk/mono/mono/metadata/verify.c
===================================================================
--- trunk/mono/mono/metadata/verify.c   2007-10-10 14:53:13 UTC (rev 87270)
+++ trunk/mono/mono/metadata/verify.c   2007-10-10 15:00:25 UTC (rev 87271)
@@ -2347,13 +2347,8 @@
        for (i = sig->param_count - 1; i >= 0; --i) {
                VERIFIER_DEBUG ( printf ("verifying argument %d\n", i); );
                value = stack_pop (ctx);
-               if (!verify_stack_type_compatibility (ctx, sig->params[i], 
value)) {
-                       if (sig->params [i]->type == MONO_TYPE_TYPEDBYREF) {
-                               ADD_VERIFY_ERROR (ctx, g_strdup_printf 
("Typedbyref field is an unverfiable type for a call parameter at 0x%04x", 
ctx->ip_offset));
-                               return;
-                       }
+               if (!verify_stack_type_compatibility (ctx, sig->params[i], 
value))
                        CODE_NOT_VERIFIABLE (ctx, g_strdup_printf 
("Incompatible parameter value with function signature at 0x%04x", 
ctx->ip_offset));
-               }
        }
 
        if (sig->hasthis) {
@@ -2373,6 +2368,11 @@
                if (check_overflow (ctx))
                        set_stack_value (stack_push (ctx), sig->ret, FALSE);
        }
+
+       if (sig->ret->type == MONO_TYPE_TYPEDBYREF
+               || sig->ret->byref
+               || (sig->ret->type == MONO_TYPE_VALUETYPE && !strcmp ("System", 
sig->ret->data.klass->name_space) && !strcmp ("ArgIterator", 
sig->ret->data.klass->name)))
+               CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Method returns 
typedbyref, byref or ArgIterator at 0x%04x", ctx->ip_offset));
 }
 
 static void
@@ -2706,7 +2706,7 @@
        }
 
        if (method->klass->flags & (TYPE_ATTRIBUTE_ABSTRACT | 
TYPE_ATTRIBUTE_INTERFACE))
-               CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Trying to 
instantiate an abstract or interface type at 0x%04x", token, ctx->ip_offset));
+               CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Trying to 
instantiate an abstract or interface type at 0x%04x", ctx->ip_offset));
 
        sig = mono_method_signature (method);
        if (!check_underflow (ctx, sig->param_count))

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

Reply via email to