Exemple #1
0
        /// <summary>
        /// Called after the method compiler has finished compiling the method.
        /// </summary>
        protected override void EndCompile()
        {
            // If we're compiling a type initializer, run it immediately.
            MethodAttributes attrs = MethodAttributes.SpecialName | MethodAttributes.RTSpecialName | MethodAttributes.Static;

            if ((this.Method.Attributes & attrs) == attrs && Method.Name == ".cctor")
            {
                CCtor cctor = (CCtor)Marshal.GetDelegateForFunctionPointer(address, typeof(CCtor));
                assemblyCompiler.QueueCCtorForInvocationAfterCompilation(cctor);
            }

            base.EndCompile();
        }