Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Improvement to last patch #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ObjCRuntime/NativeImplementationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected void DeclareLocals (ILGenerator il) {
protected void ConvertArguments (ILGenerator il, int locoffset) {
#if !MONOMAC_BOOTSTRAP
for (int i = ArgumentOffset, j = 0; i < ParameterTypes.Length; i++) {
if (Parameters [i-ArgumentOffset].ParameterType.IsByRef && (Attribute.GetCustomAttribute (Parameters [i-ArgumentOffset], typeof (OutAttribute)) == null) && IsWrappedType (Parameters[i-ArgumentOffset].ParameterType.GetElementType ())) {
if (Parameters [i-ArgumentOffset].ParameterType.IsByRef && (Attribute.GetCustomAttribute (Parameters [i-ArgumentOffset], typeof (InAttribute)) != null) && IsWrappedType (Parameters[i-ArgumentOffset].ParameterType.GetElementType ())) {
il.Emit (OpCodes.Ldarg, i);
il.Emit (OpCodes.Ldind_I);
il.Emit (OpCodes.Call, getobject);
Expand Down Expand Up @@ -237,7 +237,7 @@ protected void LoadArguments (ILGenerator il, int locoffset) {
protected void UpdateByRefArguments (ILGenerator il, int locoffset) {
#if !MONOMAC_BOOTSTRAP
for (int i = ArgumentOffset, j = 0; i < ParameterTypes.Length; i++) {
if (Parameters [i-ArgumentOffset].ParameterType.IsByRef && IsWrappedType (Parameters[i-ArgumentOffset].ParameterType.GetElementType ())) {
if (Parameters [i-ArgumentOffset].ParameterType.IsByRef && (Attribute.GetCustomAttribute (Parameters [i-ArgumentOffset], typeof (OutAttribute)) != null) && IsWrappedType (Parameters[i-ArgumentOffset].ParameterType.GetElementType ())) {
Label nullout = il.DefineLabel ();
Label done = il.DefineLabel ();
il.Emit (OpCodes.Ldloc, j+locoffset);
Expand Down