修复EvalStackCalculator计算input eval stack data类型时没有对多个inbound basic block的input计算共享类型的bug

main
walon 2025-09-06 12:26:02 +08:00
parent 5557b27724
commit b0699ecf5c
2 changed files with 1134 additions and 729 deletions

File diff suppressed because it is too large Load Diff

View File

@ -118,6 +118,34 @@ namespace Obfuz.Utils
return null;
}
public static bool IsAssignableFrom(TypeDef fromType, TypeDef toType)
{
TypeDef cur = fromType;
while (true)
{
if (cur == toType)
{
return true;
}
if (toType.IsInterface)
{
foreach (var interfaceType in cur.Interfaces)
{
TypeDef interfaceTypeDef = interfaceType.Interface.ResolveTypeDef();
if (interfaceTypeDef != null && interfaceTypeDef == toType)
{
return true;
}
}
}
cur = GetBaseTypeDef(cur);
if (cur == null)
{
return false;
}
}
}
public static bool IsInheritFromDOTSTypes(TypeDef typeDef)
{
TypeDef cur = typeDef;