File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -424,11 +424,19 @@ mono_alc_from_gchandle (MonoGCHandle alc_gchandle)
424424 if (alc_gchandle == default_alc -> gchandle )
425425 return default_alc ;
426426
427- HANDLE_FUNCTION_ENTER ();
428- MonoManagedAssemblyLoadContextHandle managed_alc = MONO_HANDLE_CAST (MonoManagedAssemblyLoadContext , mono_gchandle_get_target_handle (alc_gchandle ));
429- g_assert (!MONO_HANDLE_IS_NULL (managed_alc ));
430- MonoAssemblyLoadContext * alc = MONO_HANDLE_GETVAL (managed_alc , native_assembly_load_context );
431- HANDLE_FUNCTION_RETURN_VAL (alc );
427+ MONO_STATIC_POINTER_INIT (MonoClassField , resolve )
428+
429+ MonoClass * alc_class = mono_class_get_assembly_load_context_class ();
430+ g_assert (alc_class );
431+ resolve = mono_class_get_field_from_name_full (alc_class , "_nativeAssemblyLoadContext" , NULL );
432+
433+ MONO_STATIC_POINTER_INIT_END (MonoClassField , resolve )
434+
435+ g_assert (resolve );
436+
437+ MonoAssemblyLoadContext * alc = NULL ;
438+ mono_field_get_value_internal (mono_gchandle_get_target_internal (alc_gchandle ), resolve , & alc );
439+ return alc ;
432440}
433441
434442MonoGCHandle
Original file line number Diff line number Diff line change @@ -1406,13 +1406,6 @@ typedef enum {
14061406 UNLOADING = 1
14071407} MonoManagedAssemblyLoadContextInternalState ;
14081408
1409- // Keep in sync with System.Runtime.Loader.AssemblyLoadContext
1410- typedef struct {
1411- MonoObject object ;
1412- MonoAssemblyLoadContext * native_assembly_load_context ;
1413- } MonoManagedAssemblyLoadContext ;
1414-
1415- TYPED_HANDLE_DECL (MonoManagedAssemblyLoadContext );
14161409
14171410/* All MonoInternalThread instances should be pinned, so it's safe to use the raw ptr. However
14181411 * for uniformity, icall wrapping will make handles anyway. So this is the method for getting the payload.
You can’t perform that action at this time.
0 commit comments