revert last changes, gacutil depends on that
authorJb Evain <jbevain@gmail.com>
Fri, 23 Apr 2010 18:40:23 +0000 (18:40 -0000)
committerJb Evain <jbevain@gmail.com>
Fri, 23 Apr 2010 18:40:23 +0000 (18:40 -0000)
svn path=/trunk/mono/; revision=156024

mono/metadata/ChangeLog
mono/metadata/assembly.c
mono/metadata/domain-internals.h
mono/metadata/domain.c

index 50bdf2606e85124b137a863bdf708bc3b6fb1f4a..e30fbf25672339335daa369b471593eb7181dbcf 100644 (file)
@@ -1,15 +1,3 @@
-2010-04-23  Jb Evain  <jbevain@novell.com>
-
-       * domain.c (get_runtime_by_version): renamed to
-       mono_get_runtime_by_version.
-
-       * domain-internals.h: expose mono_get_runtime_by_version as
-       an internal function.
-
-       * assembly.c (mono_assembly_load_from_full): check if the image
-       references a newer runtime than the current executing one, and
-       mark it as invalid if it's the case.
-
 2010-04-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
 
        * threadpool.c: patch from Robert Nagy that fixes a nullref and
index f694bbe7d78add94feb345adb93b3c28d93641cf..a33d726d3a6d7c1b1f6c96c03dde229f002c477a 100644 (file)
@@ -1470,31 +1470,6 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
        return mono_assembly_open_full (filename, status, FALSE);
 }
 
-static gboolean
-image_references_newer_runtime (MonoImage *image)
-{
-       const MonoRuntimeInfo *image_runtime;
-       const char *image_version, *current_version;
-       gint i, cmp;
-
-       image_runtime = mono_get_runtime_by_version (image->version);
-       if (!image_runtime)
-               return FALSE;
-
-       image_version = image_runtime->framework_version;
-       current_version = mono_get_runtime_info ()->framework_version;
-
-       for (i = 0; i < 4; i++) {
-               cmp = (image_version [i] - '0') - (current_version [0] - '0');
-               if (cmp > 0)
-                       return TRUE;
-               else if (cmp < 0)
-                       return FALSE;
-       }
-
-       return FALSE;
-}
-
 MonoAssembly *
 mono_assembly_load_from_full (MonoImage *image, const char*fname, 
                              MonoImageOpenStatus *status, gboolean refonly)
@@ -1508,11 +1483,6 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
                return NULL;
        }
 
-       if (image_references_newer_runtime (image)) {
-               *status = MONO_IMAGE_IMAGE_INVALID;
-               return NULL;            
-       }
-
 #if defined (HOST_WIN32)
        {
                gchar *tmp_fn;
index f5379242952769906559dc1942892192ba37f88e..c4579ebe128009ee231c34a394d75a9452228af3 100644 (file)
@@ -517,9 +517,6 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
 const MonoRuntimeInfo*
 mono_get_runtime_info (void) MONO_INTERNAL;
 
-const MonoRuntimeInfo*
-mono_get_runtime_by_version (const char *version) MONO_INTERNAL;
-
 void
 mono_runtime_set_no_exec (gboolean val) MONO_INTERNAL;
 
index f3d5afa084de66e6a7ab1d0c7415e63ea436e2d4..7349c6cb28c0b63896be7ee00fcef61ffc553387 100644 (file)
@@ -149,6 +149,9 @@ extern void _mono_debug_init_corlib (MonoDomain *domain);
 static void
 get_runtimes_from_exe (const char *exe_file, MonoImage **exe_image, const MonoRuntimeInfo** runtimes);
 
+static const MonoRuntimeInfo*
+get_runtime_by_version (const char *version);
+
 static MonoImage*
 mono_jit_info_find_aot_module (guint8* addr);
 
@@ -1313,12 +1316,12 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
                mono_fixup_exe_image (exe_image);
 #endif
        } else if (runtime_version != NULL) {
-               runtimes [0] = mono_get_runtime_by_version (runtime_version);
+               runtimes [0] = get_runtime_by_version (runtime_version);
                runtimes [1] = NULL;
        }
 
        if (runtimes [0] == NULL) {
-               const MonoRuntimeInfo *default_runtime = mono_get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
+               const MonoRuntimeInfo *default_runtime = get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
                runtimes [0] = default_runtime;
                runtimes [1] = NULL;
                g_print ("WARNING: The runtime version supported by this application is unavailable.\n");
@@ -2487,13 +2490,9 @@ app_config_free (AppConfigInfo* app_config)
        g_free (app_config);
 }
 
-/**
- * mono_get_runtime_by_version:
- *
- * Returns: the runtime info for the specified version.
- */
-const MonoRuntimeInfo*
-mono_get_runtime_by_version (const char *version)
+
+static const MonoRuntimeInfo*
+get_runtime_by_version (const char *version)
 {
        int n;
        int max = G_N_ELEMENTS (supported_runtimes);
@@ -2524,7 +2523,7 @@ get_runtimes_from_exe (const char *exe_file, MonoImage **exe_image, const MonoRu
                        GSList *list = app_config->supported_runtimes;
                        while (list != NULL) {
                                version = (char*) list->data;
-                               runtime = mono_get_runtime_by_version (version);
+                               runtime = get_runtime_by_version (version);
                                if (runtime != NULL)
                                        runtimes [n++] = runtime;
                                list = g_slist_next (list);
@@ -2536,7 +2535,7 @@ get_runtimes_from_exe (const char *exe_file, MonoImage **exe_image, const MonoRu
                
                /* Check the requiredRuntime element. This is for 1.0 apps only. */
                if (app_config->required_runtime != NULL) {
-                       runtimes [0] = mono_get_runtime_by_version (app_config->required_runtime);
+                       runtimes [0] = get_runtime_by_version (app_config->required_runtime);
                        runtimes [1] = NULL;
                        app_config_free (app_config);
                        return;
@@ -2555,14 +2554,14 @@ get_runtimes_from_exe (const char *exe_file, MonoImage **exe_image, const MonoRu
                 * a default runtime and leave to the initialization method the work of
                 * reporting the error.
                 */
-               runtimes [0] = mono_get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
+               runtimes [0] = get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
                runtimes [1] = NULL;
                return;
        }
 
        *exe_image = image;
 
-       runtimes [0] = mono_get_runtime_by_version (image->version);
+       runtimes [0] = get_runtime_by_version (image->version);
        runtimes [1] = NULL;
 }