private static bool CheckOptionalArgs(ClassFile classFile, ClassFile.BootstrapMethod bsm, ClassFile.ConstantType type, ref int argpos)
        {
            if (bsm.ArgumentCount - argpos < 1)
            {
                return(false);
            }
            if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos)) != ClassFile.ConstantType.Integer)
            {
                return(false);
            }
            int count = classFile.GetConstantPoolConstantInteger(bsm.GetArgument(argpos++));

            if (count < 0 || bsm.ArgumentCount - argpos < count)
            {
                return(false);
            }
            for (int i = 0; i < count; i++)
            {
                if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos++)) != type)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
 private static bool MatchLdc(EmitIntrinsicContext eic, ref Instruction instr, ClassFile.ConstantType constantType)
 {
     return((instr.NormalizedOpCode == NormalizedByteCode.__ldc || instr.NormalizedOpCode == NormalizedByteCode.__ldc_nothrow) &&
            eic.ClassFile.GetConstantPoolConstantType(instr.NormalizedArg1) == constantType);
 }