Esempio n. 1
0
        /// <summary>
        /// Gets max stack value
        /// </summary>
        protected uint GetMaxStack()
        {
            if (instructions.Count == 0)
            {
                return(0);
            }
            uint maxStack;

            if (!MaxStackCalculator.GetMaxStack(instructions, exceptionHandlers, out maxStack))
            {
                Error("Error calculating max stack value. If the method's obfuscated, set CilBody.KeepOldMaxStack or MetaDataOptions.Flags (KeepOldMaxStack, global option) to ignore this error. Otherwise fix your generated CIL code so it conforms to the ECMA standard.");
                maxStack += 8;
            }
            return(maxStack);
        }
        /// <summary>
        /// Gets max stack value
        /// </summary>
        protected uint GetMaxStack()
        {
            if (instructions.Count == 0)
            {
                return(0);
            }
            uint maxStack;

            if (!MaxStackCalculator.GetMaxStack(instructions, exceptionHandlers, out maxStack))
            {
                Error("Error calculating max stack value");
                maxStack += 8;
            }
            return(maxStack);
        }