Exemplo n.º 1
0
 public void Branch(bool @short = false)
 {
     if (@short)
     {
         builder.Emit(OpCodes.Br_S, label);
     }
     else
     {
         builder.Emit(OpCodes.Br, label);
     }
 }
Exemplo n.º 2
0
            public void Load()
            {
                if (released)
                {
                    throw new ZCompilerException("Attempted to load local that has already been released.");
                }

                switch (local.LocalIndex)
                {
                case 0:
                    builder.Emit(OpCodes.Ldloc_0);
                    break;

                case 1:
                    builder.Emit(OpCodes.Ldloc_1);
                    break;

                case 2:
                    builder.Emit(OpCodes.Ldloc_2);
                    break;

                case 3:
                    builder.Emit(OpCodes.Ldloc_3);
                    break;

                default:
                    if (local.LocalIndex >= 4 && local.LocalIndex <= 255)
                    {
                        builder.Emit(OpCodes.Ldloc_S, local);
                    }
                    else
                    {
                        builder.Emit(OpCodes.Ldloc, local);
                    }

                    break;
                }
            }