Skip to content

Commit

Permalink
Fix a failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Jan 10, 2022
1 parent e40a4aa commit d836239
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ public override Module[] GetLoadedModules(bool getResourceModules)

internal static AssemblyName[] GetReferencedAssemblies(Assembly assembly)
{
RuntimeAssembly rtassembly = (RuntimeAssembly)assembly;
using (var nativeNames = new Mono.SafeGPtrArrayHandle(InternalGetReferencedAssemblies(new QCallAssembly(ref rtassembly))))
// Can't use QCallAssembly as assembly can be an AssemblyBuilder
using (var nativeNames = new Mono.SafeGPtrArrayHandle(InternalGetReferencedAssemblies(assembly)))
{
int numAssemblies = nativeNames.Length;
try
Expand Down Expand Up @@ -525,7 +525,7 @@ private string GetInfo(AssemblyInfoKind kind)
private static extern void GetModulesInternal(QCallAssembly assembly, ObjectHandleOnStack res);

[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern IntPtr InternalGetReferencedAssemblies(QCallAssembly module);
private static extern IntPtr InternalGetReferencedAssemblies(Assembly assembly);

internal string? GetSimpleName()
{
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/icall-def-netcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ HANDLES(RASSEM_4, "GetManifestResourceInternal", ves_icall_System_Reflection_Run
HANDLES(RASSEM_5, "GetManifestResourceNames", ves_icall_System_Reflection_RuntimeAssembly_GetManifestResourceNames, void, 2, (MonoQCallAssemblyHandle, MonoObjectHandleOnStack))
HANDLES(RASSEM_6, "GetModulesInternal", ves_icall_System_Reflection_RuntimeAssembly_GetModulesInternal, void, 2, (MonoQCallAssemblyHandle, MonoObjectHandleOnStack))
HANDLES(RASSEM_6b, "GetTopLevelForwardedTypes", ves_icall_System_Reflection_RuntimeAssembly_GetTopLevelForwardedTypes, void, 2, (MonoQCallAssemblyHandle, MonoObjectHandleOnStack))
HANDLES(RASSEM_7, "InternalGetReferencedAssemblies", ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies, GPtrArray_ptr, 1, (MonoQCallAssemblyHandle))
HANDLES(RASSEM_7, "InternalGetReferencedAssemblies", ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies, GPtrArray_ptr, 1, (MonoReflectionAssembly))

ICALL_TYPE(MCMETH, "System.Reflection.RuntimeConstructorInfo", MCMETH_1)
HANDLES(MCMETH_1, "GetGenericMethodDefinition_impl", ves_icall_RuntimeMethodInfo_GetGenericMethodDefinition, MonoReflectionMethod, 1, (MonoReflectionMethod))
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -4524,9 +4524,9 @@ create_referenced_assembly_name (MonoImage *image, int i, MonoError *error)
}

GPtrArray*
ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoQCallAssemblyHandle assembly_h, MonoError *error)
ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflectionAssemblyHandle assembly_h, MonoError *error)
{
MonoAssembly *ass = assembly_h.assembly;
MonoAssembly *ass = MONO_HANDLE_GETVAL (assembly_h, assembly);
MonoImage *image = ass->image;
int count;

Expand Down

0 comments on commit d836239

Please sign in to comment.