Skip to content

Commit

Permalink
Fix "No method found for vtable entry" for methods with void* parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sir0x1 committed Feb 26, 2024
1 parent 8ffd601 commit ad9b16f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Il2CppInterop.Runtime/Injection/ClassInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ private static bool IsTypeSupported(Type type)
if (type.IsValueType ||
type == typeof(string) ||
type.IsGenericParameter) return true;
if (type.IsByRef) return IsTypeSupported(type.GetElementType());
if (type.IsByRef || type.IsPointer) return IsTypeSupported(type.GetElementType());

return typeof(Il2CppObjectBase).IsAssignableFrom(type);
}
Expand Down Expand Up @@ -655,7 +655,7 @@ private static bool IsMethodEligible(MethodInfo method)
var parameterType = parameterInfo.ParameterType;
if (!parameterType.IsGenericParameter)
{
if (parameterType.IsByRef)
if (parameterType.IsByRef || parameterType.IsPointer)
{
var elementType = parameterType.GetElementType();
if (!elementType.IsGenericParameter)
Expand Down Expand Up @@ -1083,7 +1083,7 @@ private static Type RewriteType(Type type)
if (type.IsValueType && !type.IsEnum)
return type;

if (type == typeof(string))
if (type == typeof(string) || type == typeof(void*))
return type;

if (type.IsArray)
Expand Down

0 comments on commit ad9b16f

Please sign in to comment.