|
|
|
@ -452,6 +452,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -452,6 +452,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
// perform remaining pointer cast, if necessary
|
|
|
|
|
return pointerExpr.ConvertTo(targetType, expressionBuilder); |
|
|
|
|
} |
|
|
|
|
Expression expr; |
|
|
|
|
if (targetType.Kind == TypeKind.ByReference) |
|
|
|
|
{ |
|
|
|
|
if (NormalizeTypeVisitor.TypeErasure.EquivalentTypes(targetType, this.Type)) |
|
|
|
@ -481,7 +482,6 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -481,7 +482,6 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
// Convert from integer/pointer to reference.
|
|
|
|
|
// First, convert to the corresponding pointer type:
|
|
|
|
|
var arg = this.ConvertTo(new PointerType(elementType), expressionBuilder, checkForOverflow); |
|
|
|
|
Expression expr; |
|
|
|
|
ResolveResult elementRR; |
|
|
|
|
if (arg.Expression is UnaryOperatorExpression unary && unary.Operator == UnaryOperatorType.AddressOf) |
|
|
|
|
{ |
|
|
|
@ -561,7 +561,11 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -561,7 +561,11 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var castExpr = new CastExpression(expressionBuilder.ConvertType(targetType), Expression); |
|
|
|
|
// BaseReferenceExpression must not be used with CastExpressions
|
|
|
|
|
expr = Expression is BaseReferenceExpression |
|
|
|
|
? new ThisReferenceExpression().WithILInstruction(this.ILInstructions) |
|
|
|
|
: Expression; |
|
|
|
|
var castExpr = new CastExpression(expressionBuilder.ConvertType(targetType), expr); |
|
|
|
|
bool needsCheckAnnotation = targetUType.GetStackType().IsIntegerType(); |
|
|
|
|
if (needsCheckAnnotation) |
|
|
|
|
{ |
|
|
|
|