This commit is contained in:
kmyuhkyuk 2022-10-19 10:48:12 +08:00
parent e6308df25f
commit fc0a11fd65

View File

@ -83,16 +83,18 @@ namespace SkinHide.Utils
{
ilGen.Emit(OpCodes.Ldarg, i);
bool isvaluetype = parameterTypes[i].IsValueType;
Type parameterType = parameterTypes[i];
bool isvaluetype = parameterType.IsValueType;
if (!isvaluetype)
{
ilGen.Emit(OpCodes.Castclass, parameterTypes[i]);
ilGen.Emit(OpCodes.Castclass, parameterType);
}
//DelegateparameterTypes i == parameterTypes i
else if (delegateParameterTypes[i] == typeof(object) && isvaluetype)
{
ilGen.Emit(OpCodes.Unbox_Any, parameterTypes[i]);
ilGen.Emit(OpCodes.Unbox_Any, parameterType);
}
}