修复SymbolRename::CollectCArgumentWithTypeOf没考虑到NamedArgument有可能名称发生改变,仅仅判断了类型或者值是否可能包含类型引用,导致跳过收集 `[MyCustom(X=1)]`这样的属性的bug

before-split
walon 2025-05-24 09:49:14 +08:00
parent b2d7637438
commit 1cd1b912ec
1 changed files with 2 additions and 6 deletions

View File

@ -74,12 +74,8 @@ namespace Obfuz.ObfusPasses.SymbolObfus
{
arguments = ca.ConstructorArguments.ToList();
}
List<CANamedArgument> namedArguments = null;
if (ca.NamedArguments.Any(a => MetaUtil.MayRenameCustomDataType(a.Type.ElementType)))
{
namedArguments = ca.NamedArguments.ToList();
}
if (arguments != null | namedArguments != null)
List<CANamedArgument> namedArguments = ca.NamedArguments.Count > 0 ? ca.NamedArguments.ToList() : null;
if (arguments != null || namedArguments != null)
{
customAttributes.Add(new CustomAttributeInfo
{