Browse Source

Fix #1514: Allow StackType.I8 and StackType.I4 in HandleManagedPointerArithmetic (ref [+-] int).

pull/1633/head
Siegfried Pammer 6 years ago
parent
commit
84b9f1c4f4
  1. 2
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

2
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -1085,7 +1085,7 @@ namespace ICSharpCode.Decompiler.CSharp
// ref - ref => i // ref - ref => i
return CallUnsafeIntrinsic("ByteOffset", new[] { left.Expression, right.Expression }, compilation.FindType(KnownTypeCode.IntPtr), inst); return CallUnsafeIntrinsic("ByteOffset", new[] { left.Expression, right.Expression }, compilation.FindType(KnownTypeCode.IntPtr), inst);
} }
if (inst.LeftInputType == StackType.Ref && inst.RightInputType == StackType.I if (inst.LeftInputType == StackType.Ref && inst.RightInputType.IsIntegerType()
&& left.Type is ByReferenceType brt) { && left.Type is ByReferenceType brt) {
// ref [+-] int // ref [+-] int
string name = (inst.Operator == BinaryNumericOperator.Sub ? "Subtract" : "Add"); string name = (inst.Operator == BinaryNumericOperator.Sub ? "Subtract" : "Add");

Loading…
Cancel
Save