Skip to content

Commit

Permalink
Fix issue icsharpcode#1224
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung committed Jul 29, 2018
1 parent c9391e1 commit 9837933
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 9837933

Please sign in to comment.