[Mono-devel-list] Patch not to inline methods with security attributes

Paolo Molaro lupus at ximian.com
Mon Nov 15 03:57:06 EST 2004


On 11/12/04 Sebastien Pouliot wrote:
> /*
>  * Does the methods (or it's class) as any declarative security attribute ?
>  * Is so are they applicable ? (e.g. static class constructor)
>  */
> inline MonoBoolean
> mono_method_has_declsec (MonoMethod *method)

No need for inline here.

> Index: mini.c
> ===================================================================
> --- mini.c	(revision 36050)
> +++ mini.c	(working copy)
> @@ -2350,6 +2350,13 @@
>  	MonoVTable *vtable;
>  	int i;
>  
> +	/*
> +	 * CAS - do not inline methods with declarative security
> +	 * Note: this has to be before any possible return TRUE;
> +	 */
> +	if (mono_method_has_declsec (method))
> +		return FALSE;
> +

Put the check after the others: it's unlikely it will match before
the others, so we'd call the function all the time for nothing.

Please commit after the change.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list