Skip to content

Commit

Permalink
[nnyeah] IConvertible ancient history (#14945)
Browse files Browse the repository at this point in the history
This was old code that hung around from before we discovered that we can't fully handle `IConvertible`
  • Loading branch information
stephen-hawley authored May 9, 2022
1 parent ff40b22 commit d8dfd37
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions tools/nnyeah/nnyeah/MethodTransformations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,6 @@ public Dictionary<string, Transformation> GetTransforms (ModuleDefinition module
Instruction.Create (OpCodes.Call, mref)
}));

var iconvertibleTypeRef = new TypeReference ("System", "IConvertible", module, module.TypeSystem.CoreLibrary);
var iformatProviderTypeRef = new TypeReference ("System", "IFormatProvider", module, module.TypeSystem.CoreLibrary);
var iformatProviderVar = new VariableDefinition (iformatProviderTypeRef);
mref = new MethodReference ("ToBoolean", module.TypeSystem.Boolean, iconvertibleTypeRef);
mref = module.ImportReference (mref);
allTransforms.Add (new Transformation ("System.Boolean System.nint::System.IConvertible.ToBoolean(System.IFormatProvider)",
TransformationAction.Replace,
new List<Instruction> () {
Instruction.Create (OpCodes.Stloc, iformatProviderVar),
Instruction.Create (OpCodes.Unbox, module.TypeSystem.IntPtr),
Instruction.Create (OpCodes.Conv_I8),
Instruction.Create (OpCodes.Box, module.TypeSystem.Int64),
Instruction.Create (OpCodes.Ldloc, iformatProviderVar),
Instruction.Create (OpCodes.Call, mref)
}));

var marshalTypeReference = new TypeReference ("System.Runtime.InteropServices", "Marshal", module, module.TypeSystem.CoreLibrary);
mref = new MethodReference ("CopyArray", module.TypeSystem.Void, marshalTypeReference);
mref.Parameters.Add (new ParameterDefinition (module.TypeSystem.IntPtr));
Expand Down

4 comments on commit d8dfd37

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.