@@ -309,37 +309,6 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
309309 HANDLE_FUNCTION_RETURN ();
310310}
311311
312- static char *
313- mono_get_corlib_version (void )
314- {
315- ERROR_DECL (error );
316-
317- MonoClass * klass ;
318- MonoClassField * field ;
319-
320- klass = mono_class_load_from_name (mono_defaults .corlib , "System" , "Environment" );
321- mono_class_init_internal (klass );
322- field = mono_class_get_field_from_name_full (klass , "mono_corlib_version" , NULL );
323- if (!field )
324- return NULL ;
325-
326- if (! (field -> type -> attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_LITERAL )))
327- return NULL ;
328-
329- char * value ;
330- MonoTypeEnum field_type ;
331- const char * data = mono_class_get_field_default_value (field , & field_type );
332- if (field_type != MONO_TYPE_STRING )
333- return NULL ;
334- mono_metadata_read_constant_value (data , field_type , & value , error );
335- mono_error_assert_ok (error );
336-
337- char * res = mono_string_from_blob (value , error );
338- mono_error_assert_ok (error );
339-
340- return res ;
341- }
342-
343312/**
344313 * mono_check_corlib_version:
345314 * Checks that the corlib that is loaded matches the version of this runtime.
@@ -364,18 +333,6 @@ mono_check_corlib_version_internal (void)
364333 return NULL ;
365334#else
366335 char * result = NULL ;
367- char * version = mono_get_corlib_version ();
368- if (!version ) {
369- result = g_strdup_printf ("expected corlib string (%s) but not found or not string" , MONO_CORLIB_VERSION );
370- goto exit ;
371- }
372- if (strcmp (version , MONO_CORLIB_VERSION ) != 0 ) {
373- result = g_strdup_printf ("The runtime did not find the mscorlib.dll it expected. "
374- "Expected interface version %s but found %s. Check that "
375- "your runtime and class libraries are matching." ,
376- MONO_CORLIB_VERSION , version );
377- goto exit ;
378- }
379336
380337 /* Check that the managed and unmanaged layout of MonoInternalThread matches */
381338 guint32 native_offset ;
@@ -384,8 +341,6 @@ mono_check_corlib_version_internal (void)
384341 managed_offset = mono_field_get_offset (mono_class_get_field_from_name_full (mono_defaults .internal_thread_class , "last" , NULL ));
385342 if (native_offset != managed_offset )
386343 result = g_strdup_printf ("expected InternalThread.last field offset %u, found %u. See InternalThread.last comment" , native_offset , managed_offset );
387- exit :
388- g_free (version );
389344 return result ;
390345#endif
391346}
0 commit comments