Open slxdy opened 9 months ago
My current workaround (not really safe):
public static Instruction CreateInstructionRaw(OpCode opCode, object? operand = null)
{
var instruction = (Instruction)RuntimeHelpers.GetUninitializedObject(typeof(Instruction));
instruction.OpCode = opCode;
instruction.Operand = operand;
return instruction;
}
Because this isn't currently possible, cloning instructions or pre-making instructions before assigning their operator is hell. It's an unnecessary limitation that simply shouldn't exist.