|
|
|
|
@ -1108,6 +1108,21 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -1108,6 +1108,21 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
left = left.ConvertTo(inputType, this); |
|
|
|
|
right = right.ConvertTo(inputType, this); |
|
|
|
|
} |
|
|
|
|
else if (inst.InputType == StackType.O) |
|
|
|
|
{ |
|
|
|
|
// Unsafe.As<object, UIntPtr>(ref left) op Unsafe.As<object, UIntPtr>(ref right)
|
|
|
|
|
// TTo Unsafe.As<TFrom, TTo>(ref TFrom source)
|
|
|
|
|
var uintptr = compilation.FindType(KnownTypeCode.UIntPtr); |
|
|
|
|
left = WrapInUnsafeAs(left, inst.Left); |
|
|
|
|
right = WrapInUnsafeAs(right, inst.Right); |
|
|
|
|
|
|
|
|
|
TranslatedExpression WrapInUnsafeAs(TranslatedExpression expr, ILInstruction inst) |
|
|
|
|
{ |
|
|
|
|
var type = expr.Type; |
|
|
|
|
expr = WrapInRef(expr, new ByReferenceType(type)); |
|
|
|
|
return CallUnsafeIntrinsic("As", [expr], uintptr, typeArguments: [type, uintptr]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return new BinaryOperatorExpression(left.Expression, op, right.Expression) |
|
|
|
|
.WithILInstruction(inst) |
|
|
|
|
.WithRR(new OperatorResolveResult(compilation.FindType(TypeCode.Boolean), |
|
|
|
|
|