|
|
@ -459,6 +459,16 @@ namespace ICSharpCode.Decompiler.IL.Transforms |
|
|
|
return conv.TargetType != type.ToPrimitiveType(); |
|
|
|
return conv.TargetType != type.ToPrimitiveType(); |
|
|
|
} else if (value is Comp) { |
|
|
|
} else if (value is Comp) { |
|
|
|
return false; // comp returns 0 or 1, which always fits
|
|
|
|
return false; // comp returns 0 or 1, which always fits
|
|
|
|
|
|
|
|
} else if (value is BinaryNumericInstruction bni) { |
|
|
|
|
|
|
|
switch (bni.Operator) { |
|
|
|
|
|
|
|
case BinaryNumericOperator.BitAnd: |
|
|
|
|
|
|
|
case BinaryNumericOperator.BitOr: |
|
|
|
|
|
|
|
case BinaryNumericOperator.BitXor: |
|
|
|
|
|
|
|
// If both input values fit into the type without truncation,
|
|
|
|
|
|
|
|
// the result of a binary operator will also fit.
|
|
|
|
|
|
|
|
return IsImplicitTruncation(bni.Left, type, compilation, allowNullableValue) |
|
|
|
|
|
|
|
|| IsImplicitTruncation(bni.Right, type, compilation, allowNullableValue); |
|
|
|
|
|
|
|
} |
|
|
|
} else if (value is IfInstruction ifInst) { |
|
|
|
} else if (value is IfInstruction ifInst) { |
|
|
|
return IsImplicitTruncation(ifInst.TrueInst, type, compilation, allowNullableValue) |
|
|
|
return IsImplicitTruncation(ifInst.TrueInst, type, compilation, allowNullableValue) |
|
|
|
|| IsImplicitTruncation(ifInst.FalseInst, type, compilation, allowNullableValue); |
|
|
|
|| IsImplicitTruncation(ifInst.FalseInst, type, compilation, allowNullableValue); |
|
|
|