Author: kumpera Date: 2008-02-18 12:53:25 -0500 (Mon, 18 Feb 2008) New Revision: 96086
Modified: trunk/mono/mono/metadata/ChangeLog trunk/mono/mono/metadata/verify.c trunk/mono/mono/metadata/verify.h Log: 2008-02-18 Rodrigo Kumpera <[EMAIL PROTECTED]> * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended which contains an extra field to tell the kind of exception that should be thrown. * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo. Modified: trunk/mono/mono/metadata/ChangeLog =================================================================== --- trunk/mono/mono/metadata/ChangeLog 2008-02-18 17:45:23 UTC (rev 96085) +++ trunk/mono/mono/metadata/ChangeLog 2008-02-18 17:53:25 UTC (rev 96086) @@ -1,3 +1,10 @@ +2008-02-18 Rodrigo Kumpera <[EMAIL PROTECTED]> + + * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended + which contains an extra field to tell the kind of exception that should be thrown. + + * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo. + 2008-02-17 Raja R Harinath <[EMAIL PROTECTED]> * loader.c (mono_method_get_param_names): Initialize 'klass' after Modified: trunk/mono/mono/metadata/verify.c =================================================================== --- trunk/mono/mono/metadata/verify.c 2008-02-18 17:45:23 UTC (rev 96085) +++ trunk/mono/mono/metadata/verify.c 2008-02-18 17:53:25 UTC (rev 96086) @@ -39,9 +39,9 @@ #define ADD_VERIFY_INFO(__ctx, __msg, __status) \ do { \ - MonoVerifyInfo *vinfo = g_new (MonoVerifyInfo, 1); \ - vinfo->status = __status; \ - vinfo->message = ( __msg ); \ + MonoVerifyInfoExtended *vinfo = g_new (MonoVerifyInfoExtended, 1); \ + vinfo->info.status = __status; \ + vinfo->info.message = ( __msg ); \ (__ctx)->list = g_slist_prepend ((__ctx)->list, vinfo); \ } while (0) @@ -364,12 +364,12 @@ void mono_free_verify_list (GSList *list) { - MonoVerifyInfo *info; + MonoVerifyInfoExtended *info; GSList *tmp; for (tmp = list; tmp; tmp = tmp->next) { info = tmp->data; - g_free (info->message); + g_free (info->info.message); g_free (info); } g_slist_free (list); @@ -377,17 +377,17 @@ #define ADD_ERROR(list,msg) \ do { \ - MonoVerifyInfo *vinfo = g_new (MonoVerifyInfo, 1); \ - vinfo->status = MONO_VERIFY_ERROR; \ - vinfo->message = (msg); \ + MonoVerifyInfoExtended *vinfo = g_new (MonoVerifyInfoExtended, 1); \ + vinfo->info.status = MONO_VERIFY_ERROR; \ + vinfo->info.message = (msg); \ (list) = g_slist_prepend ((list), vinfo); \ } while (0) #define ADD_WARN(list,code,msg) \ do { \ - MonoVerifyInfo *vinfo = g_new (MonoVerifyInfo, 1); \ - vinfo->status = (code); \ - vinfo->message = (msg); \ + MonoVerifyInfoExtended *vinfo = g_new (MonoVerifyInfoExtended, 1); \ + vinfo->info.status = (code); \ + vinfo->info.message = (msg); \ (list) = g_slist_prepend ((list), vinfo); \ } while (0) @@ -1012,7 +1012,7 @@ #define ADD_INVALID(list,msg) \ do { \ - MonoVerifyInfo *vinfo = g_new (MonoVerifyInfo, 1); \ + MonoVerifyInfoExtended *vinfo = g_new (MonoVerifyInfoExtended, 1); \ vinfo->status = MONO_VERIFY_ERROR; \ vinfo->message = (msg); \ (list) = g_slist_prepend ((list), vinfo); \ @@ -3989,6 +3989,8 @@ ctx.num_locals = ctx.header->num_locals; ctx.locals = ctx.header->locals; + if (ctx.num_locals > 0 && !ctx.header->init_locals) + CODE_NOT_VERIFIABLE (&ctx, g_strdup_printf ("Method with locals variable but without init locals set")); if (ctx.signature->hasthis) { ctx.params = g_new0 (MonoType*, ctx.max_args); Modified: trunk/mono/mono/metadata/verify.h =================================================================== --- trunk/mono/mono/metadata/verify.h 2008-02-18 17:45:23 UTC (rev 96085) +++ trunk/mono/mono/metadata/verify.h 2008-02-18 17:53:25 UTC (rev 96086) @@ -4,6 +4,7 @@ #include <mono/metadata/metadata.h> #include <mono/metadata/image.h> #include <mono/metadata/loader.h> +#include "mono/utils/mono-compiler.h" G_BEGIN_DECLS @@ -14,6 +15,9 @@ MONO_VERIFY_CLS = 4, MONO_VERIFY_ALL = 7, + /* Status signaling code that is not verifiable.*/ + MONO_VERIFY_NOT_VERIFIABLE = 8, + /*OR it with other flags*/ /* Abort the verification if the code is not verifiable. @@ -29,8 +33,8 @@ */ MONO_VERIFY_NON_STRICT = 32, - /* Status signaling code that is not verifiable.*/ - MONO_VERIFY_NOT_VERIFIABLE = 8 + /*Skip all visibility related checks*/ + MONO_VERIFY_SKIP_VISIBILITY = 64, } MonoVerifyStatus; typedef struct { @@ -38,6 +42,12 @@ MonoVerifyStatus status; } MonoVerifyInfo; +typedef struct { + MonoVerifyInfo info; + guint8 exception_type; /*should be one of MONO_EXCEPTION_* */ +} MonoVerifyInfoExtended; + + GSList* mono_image_verify_tables (MonoImage *image, int level); GSList* mono_method_verify (MonoMethod *method, int level); void mono_free_verify_list (GSList *list); _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches