修复EvalStackCalculator计算input eval stack data类型时没有对多个inbound basic block的input计算共享类型的bug
parent
5557b27724
commit
b0699ecf5c
File diff suppressed because it is too large
Load Diff
|
@ -118,6 +118,34 @@ namespace Obfuz.Utils
|
||||||
return null;
|
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)
|
public static bool IsInheritFromDOTSTypes(TypeDef typeDef)
|
||||||
{
|
{
|
||||||
TypeDef cur = typeDef;
|
TypeDef cur = typeDef;
|
||||||
|
|
Loading…
Reference in New Issue