/// <summary> /// Decodes the specified instruction. /// </summary> /// <param name="ctx">The context.</param> /// <param name="decoder">The instruction decoder, which holds the code stream.</param> public override void Decode(Context ctx, IInstructionDecoder decoder) { // Decode base classes first base.Decode(ctx, decoder); // Retrieve the number of branch targets uint count = decoder.DecodeUInt(); ctx.AllocateBranchTargets(count + 1); // Populate the array for (uint i = 0; i < count; i++) ctx.BranchTargets[i] = decoder.DecodeInt(); }
/// <summary> /// Decodes the specified instruction. /// </summary> /// <param name="ctx">The context.</param> /// <param name="decoder">The instruction decoder, which holds the code stream.</param> public override void Decode(Context ctx, IInstructionDecoder decoder) { // Decode base classes first base.Decode(ctx, decoder); var targets = (int[])decoder.Instruction.Operand; ctx.AllocateBranchTargets((uint)targets.Length + 1); // Populate the array for (int i = 0; i < targets.Length; i++) ctx.BranchTargets[i] = targets[i]; ctx.BranchTargets[targets.Length] = decoder.Instruction.Next.Value; }