|
|
|
@ -849,7 +849,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -849,7 +849,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
args[args.Count - 1].AddAnnotation(new ParameterDeclarationAnnotation(byteCode)); |
|
|
|
|
return args[args.Count - 1]; |
|
|
|
|
case ILCode.Await: |
|
|
|
|
return new UnaryOperatorExpression(UnaryOperatorType.Await, arg1); |
|
|
|
|
return new UnaryOperatorExpression(UnaryOperatorType.Await, UnpackDirectionExpression(arg1)); |
|
|
|
|
case ILCode.NullableOf: |
|
|
|
|
case ILCode.ValueOf: |
|
|
|
|
return arg1; |
|
|
|
@ -975,10 +975,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -975,10 +975,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
|
|
|
|
|
// Unpack any DirectionExpression that is used as target for the call
|
|
|
|
|
// (calling methods on value types implicitly passes the first argument by reference)
|
|
|
|
|
if (target is DirectionExpression) { |
|
|
|
|
target = ((DirectionExpression)target).Expression; |
|
|
|
|
target.Remove(); // detach from DirectionExpression
|
|
|
|
|
} |
|
|
|
|
target = UnpackDirectionExpression(target); |
|
|
|
|
|
|
|
|
|
if (cecilMethodDef != null) { |
|
|
|
|
// convert null.ToLower() to ((string)null).ToLower()
|
|
|
|
@ -1078,6 +1075,15 @@ namespace ICSharpCode.Decompiler.Ast
@@ -1078,6 +1075,15 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
return target.Invoke(cecilMethod.Name, ConvertTypeArguments(cecilMethod), methodArgs).WithAnnotation(cecilMethod); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static Expression UnpackDirectionExpression(Expression target) |
|
|
|
|
{ |
|
|
|
|
if (target is DirectionExpression) { |
|
|
|
|
return ((DirectionExpression)target).Expression.Detach(); |
|
|
|
|
} else { |
|
|
|
|
return target; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void AdjustArgumentsForMethodCall(MethodReference cecilMethod, List<Expression> methodArgs) |
|
|
|
|
{ |
|
|
|
|
// Convert 'ref' into 'out' where necessary
|
|
|
|
|