private static void CopyBranchStackSize(Instruction instruction, ref Dictionary <Instruction, int> stack_sizes, int stack_size)
{
if (stack_size == 0)
{
return;
}
OperandType operandType = instruction.opcode.OperandType;
if (operandType != OperandType.InlineBrTarget)
{
if (operandType == OperandType.InlineSwitch)
{
Instruction[] instructionArray = (Instruction[])instruction.operand;
for (int i = 0; i < (int)instructionArray.Length; i++)
{
CodeWriter.CopyBranchStackSize(ref stack_sizes, instructionArray[i], stack_size);
}
}
else if (operandType == OperandType.ShortInlineBrTarget)
{
CodeWriter.CopyBranchStackSize(ref stack_sizes, (Instruction)instruction.operand, stack_size);
return;
}
return;
}
CodeWriter.CopyBranchStackSize(ref stack_sizes, (Instruction)instruction.operand, stack_size);
}