Browse Source

Support logic.and/etc. in IsImplicitTruncation().

pull/1129/head
Daniel Grunwald 7 years ago
parent
commit
25706f2a39
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs

3
ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs

@ -361,6 +361,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return conv.TargetType != type.ToPrimitiveType();
} else if (value is Comp) {
return false; // comp returns 0 or 1, which always fits
} else if (value is IfInstruction ifInst) {
return IsImplicitTruncation(ifInst.TrueInst, type, allowNullableValue)
|| IsImplicitTruncation(ifInst.FalseInst, type, allowNullableValue);
} else {
IType inferredType = value.InferType();
if (allowNullableValue) {

Loading…
Cancel
Save