Constructors signatures must be hasthis.
authorRodrigo Kumpera <kumpera@gmail.com>
Mon, 18 Oct 2010 19:45:50 +0000 (17:45 -0200)
committerRodrigo Kumpera <kumpera@gmail.com>
Mon, 18 Oct 2010 19:50:22 +0000 (17:50 -0200)
* verify.c (do_newobj): Check if the .ctor signature is
hasthis. Even thou this is not a string 335 requirement
our runtime asserts otherwise.

Fixes #568004

mono/metadata/verify.c

index ab015cc27ce809ec9f07addc72ac90b71a781027..08a4ab6921f8f5fdd6c6aab92e84994eb6d30f75 100644 (file)
@@ -3558,6 +3558,11 @@ do_newobj (VerifyContext *ctx, int token)
                return;
        }
 
+       if (!sig->hasthis) {
+               ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Invalid constructor signature missing hasthis at 0x%04x", ctx->ip_offset));
+               return;
+       }
+
        if (!check_underflow (ctx, sig->param_count))
                return;