Don't treat System.Void as a value type
This commit is contained in:
parent
45a11310de
commit
445b68f4f5
|
@ -229,7 +229,12 @@ namespace de4dot.blocks.cflow {
|
|||
}
|
||||
|
||||
protected static bool isValueType(IType type) {
|
||||
return type != null && type.IsValueType;
|
||||
if (type == null)
|
||||
return false;
|
||||
var ts = type as TypeSig;
|
||||
if (ts == null)
|
||||
return type.IsValueType;
|
||||
return ts.IsValueType && ts.ElementType != ElementType.Void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace de4dot.code.deobfuscators.Babel_NET {
|
|||
protected override bool isCompatibleType(int paramIndex, IType origType, IType newType) {
|
||||
if (new SigComparer().Equals(origType, newType))
|
||||
return true;
|
||||
if (newType.IsValueType || origType.IsValueType)
|
||||
if (isValueType(newType) || isValueType(origType))
|
||||
return false;
|
||||
return newType.FullName == "System.Object";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user