diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs index b38857dd1f..6ac88cc354 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs @@ -660,7 +660,11 @@ ILInstruction PrepareCallTarget(IType expectedType, ILInstruction target, IType if (target == null) { return (new LdObj(new LdsFlda((IField)member), member.ReturnType), member.ReturnType); } else { - return (new LdObj(new LdFlda(target, (IField)member), member.ReturnType), member.ReturnType); + if (member.DeclaringType.IsReferenceType == true) { + return (new LdObj(new LdFlda(target, (IField)member), member.ReturnType), member.ReturnType); + } else { + return (new LdObj(new LdFlda(new AddressOf(target), (IField)member), member.ReturnType), member.ReturnType); + } } }