4 Commits
Author SHA1 Message Date
ds5678 c56f1aa207 Bump version to 1.3.2
Updated VersionPrefix in Directory.Build.props from 1.3.1 to 1.3.2 to prepare for a new release.
2026-08-09 11:46:13 -07:00
ds5678 eee7febc56 Remove all AsmResolver importer calls, they're not needed any more 2026-08-09 11:45:29 -07:00
ds5678 42e10fc7d2 Update NuGet package versions in CIL projects
Upgraded dependencies in AssetRipper.CIL.csproj (AsmResolver.DotNet to 6.0.1, PolySharp to 1.16.0) and AssetRipper.CIL.Tests.csproj (Microsoft.NET.Test.Sdk to 18.8.1, NUnit to 4.6.1, NUnit.Analyzers to 4.14.0, NUnit3TestAdapter to 6.2.0). No other changes made.
2026-08-09 11:44:23 -07:00
ds5678 ed3efe58f7 Instantiate generic types when calling base constructor during method stubbing 2026-04-09 19:21:40 -07:00
6 changed files with 14 additions and 14 deletions

No files matched your search

@@ -9,13 +9,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="NUnit" Version="4.5.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="NUnit" Version="4.6.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.14.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
</ItemGroup>
<ItemGroup>
+2 -2
View File
@@ -15,8 +15,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AsmResolver.DotNet" Version="6.0.0-rc.1" />
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="AsmResolver.DotNet" Version="6.0.1" />
<PackageReference Include="PolySharp" Version="1.16.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
</ItemGroup>
@@ -61,7 +61,7 @@ public static class IHasCustomAttributeExtensions
{
TypeReference flagsTypeRef = new(module.CorLibTypeFactory.CorLibScope, "System", nameof(FlagsAttribute));
MemberReference constructor = new(flagsTypeRef, ".ctor", MethodSignature.CreateInstance(module.CorLibTypeFactory.Void));
return _this.AddCustomAttribute(module.DefaultImporter.ImportMethod(constructor));
return _this.AddCustomAttribute(constructor);
}
}
@@ -86,7 +86,7 @@ public static class IHasCustomAttributeExtensions
MemberReference constructor = new(compilerGeneratedTypeRef, ".ctor", MethodSignature.CreateInstance(module.CorLibTypeFactory.Void));
return _this.AddCustomAttribute(module.DefaultImporter.ImportMethod(constructor));
return _this.AddCustomAttribute(constructor);
}
static AssemblyReference GetOrAddReferenceToSystemRuntimeCompilerServices(ModuleDefinition module)
+4 -4
View File
@@ -71,10 +71,11 @@ internal static class MethodStubber
MethodSignature? methodSignature = baseConstructor.Signature;
if (methodSignature is not null)
{
GenericContext genericContext = GenericContext.FromMethod(baseConstructor);
methodInstructions.Add(CilOpCodes.Ldarg_0);
foreach (TypeSignature baseParameterType in methodSignature.ParameterTypes)
{
methodInstructions.AddDefaultValue(baseParameterType);
methodInstructions.AddDefaultValue(baseParameterType.InstantiateGenericTypes(genericContext));
}
methodInstructions.Add(CilOpCodes.Call, baseConstructor);
}
@@ -142,7 +143,7 @@ internal static class MethodStubber
}
else
{
return methodDefinition.DeclaringType.DeclaringModule.DefaultImporter.ImportMethod(baseConstructor);
return baseConstructor;
}
}
else if (baseType is TypeSpecification baseTypeSpec)
@@ -162,8 +163,7 @@ internal static class MethodStubber
{
return null;
}
IMethodDefOrRef baseConstructorImported = methodDefinition.DeclaringType.DeclaringModule.DefaultImporter.ImportMethod(baseConstructor);
return new MemberReference(baseType, baseConstructorImported.Name, baseConstructorImported.Signature);
return new MemberReference(baseType, baseConstructor.Name, baseConstructor.Signature);
}
return null;
@@ -25,7 +25,7 @@ public static class ModuleDefinitionExtensions
?? throw new ArgumentOutOfRangeException(nameof(underlyingType), underlyingType, null);
TypeReference baseType = new(module.CorLibTypeFactory.CorLibScope, "System", "Enum");
TypeDefinition type = new(@namespace, name, visibility.ToTypeAttributes() | TypeAttributes.Sealed, module.DefaultImporter.ImportType(baseType));
TypeDefinition type = new(@namespace, name, visibility.ToTypeAttributes() | TypeAttributes.Sealed, baseType);
module.TopLevelTypes.Add(type);
AddEnumValue(type, underlyingTypeSignature);
return type;
+1 -1
View File
@@ -5,7 +5,7 @@
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
<VersionPrefix>1.3.1</VersionPrefix>
<VersionPrefix>1.3.2</VersionPrefix>
<Copyright>Copyright (c) 2025 ds5678</Copyright>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>