In MethodBody.cs, the methods SimplifyFromSByte/SimplifyFromByte cast
the operand of an instruction to a sbyte/byte. The operand is actually
an instruction, so the cast fails.
static void SimplifyFromSByte (Instruction i, OpCode op)
{
i.OpCode = op;
i.Operand = (int) (sbyte) i.Operand;
}
static void SimplifyFromByte (Instruction i, OpCode op)
{
i.OpCode = op;
i.Operand = (int) (byte) i.Operand;
}
I guess the Operand should be replaced with Offset in both methods.
best regards,
Dries
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---