2009-06-04 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / verify.c
index 532ded0875e370856926d85d26d90244edd19903..dd71ec610f07f1e3bd142449a4198ad3766d2ecb 100644 (file)
@@ -7,6 +7,7 @@
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  */
+#include <config.h>
 
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/verify.h>
 #include <ctype.h>
 
 
+static MiniVerifierMode verifier_mode = MONO_VERIFIER_MODE_OFF;
+static gboolean verify_all = FALSE;
+
+/*
+ * Set the desired level of checks for the verfier.
+ * 
+ */
+void
+mono_verifier_set_mode (MiniVerifierMode mode)
+{
+       verifier_mode = mode;
+}
+
+void
+mono_verifier_enable_verify_all ()
+{
+       verify_all = TRUE;
+}
+
+#ifndef DISABLE_VERIFIER
 /*
  * Pull the list of opcodes
  */
@@ -3313,7 +3334,7 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual)
                if (!verify_stack_type_compatibility (ctx, sig->params[i], value)) {
                        char *stack_name = stack_slot_full_name (value);
                        char *sig_name = mono_type_full_name (sig->params [i]);
-                       CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Incompatible parameter value with function signature: %s X %s at 0x%04x", sig_name, stack_name, ctx->ip_offset));
+                       CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Incompatible parameter with function signature: Calling method with signature (%s) but for argument %d there is a (%s) on stack at 0x%04x", sig_name, i, stack_name, ctx->ip_offset));
                        g_free (stack_name);
                        g_free (sig_name);
                }
@@ -5859,25 +5880,6 @@ mono_verify_corlib ()
        return NULL;
 }
 
-static MiniVerifierMode verifier_mode = MONO_VERIFIER_MODE_OFF;
-static gboolean verify_all = FALSE;
-
-/*
- * Set the desired level of checks for the verfier.
- * 
- */
-void
-mono_verifier_set_mode (MiniVerifierMode mode)
-{
-       verifier_mode = mode;
-}
-
-void
-mono_verifier_enable_verify_all ()
-{
-       verify_all = TRUE;
-}
-
 /*
  * Returns true if @method needs to be verified.
  * 
@@ -6002,3 +6004,75 @@ mono_verifier_verify_class (MonoClass *class)
                return FALSE;
        return TRUE;
 }
+#else
+
+gboolean
+mono_verifier_verify_class (MonoClass *class)
+{
+       /* The verifier was disabled at compile time */
+       return TRUE;
+}
+
+GSList*
+mono_method_verify_with_current_settings (MonoMethod *method, gboolean skip_visibility)
+{
+       /* The verifier was disabled at compile time */
+       return NULL;
+}
+
+gboolean
+mono_verifier_is_class_full_trust (MonoClass *klass)
+{
+       /* The verifier was disabled at compile time */
+       return TRUE;
+}
+
+gboolean
+mono_verifier_is_method_full_trust (MonoMethod *method)
+{
+       /* The verifier was disabled at compile time */
+       return TRUE;
+}
+
+gboolean
+mono_verifier_is_enabled_for_image (MonoImage *image)
+{
+       /* The verifier was disabled at compile time */
+       return FALSE;
+}
+
+gboolean
+mono_verifier_is_enabled_for_class (MonoClass *klass)
+{
+       /* The verifier was disabled at compile time */
+       return FALSE;
+}
+
+gboolean
+mono_verifier_is_enabled_for_method (MonoMethod *method)
+{
+       /* The verifier was disabled at compile time */
+       return FALSE;
+}
+
+GSList*
+mono_method_verify (MonoMethod *method, int level)
+{
+       /* The verifier was disabled at compile time */
+       return NULL;
+}
+
+void
+mono_free_verify_list (GSList *list)
+{
+       /* The verifier was disabled at compile time */
+       /* will always be null if verifier is disabled */
+}
+
+GSList*
+mono_image_verify_tables (MonoImage *image, int level)
+{
+       /* The verifier was disabled at compile time */
+       return NULL;
+}      
+#endif