2003-03-06 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Thu, 6 Mar 2003 17:12:25 +0000 (17:12 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 6 Mar 2003 17:12:25 +0000 (17:12 -0000)
* ILGenerator.cs (Emit): Do not pop the arguments off the stack for
ldftn etc. Fixes #39196.

svn path=/trunk/mcs/; revision=12258

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs

index df28513f18bda592d09ec055b7d266202ff1cd8c..64b3c5ab180e8767ee595c430cd4004bf287a813 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-06  Zoltan Varga  <vargaz@freemail.hu>
+
+       * ILGenerator.cs (Emit): Do not pop the arguments off the stack for
+       ldftn etc. Fixes bug #39196.
+
 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
 
        * ILGenerator.cs (Emit): Add fixup for already created methods and
index aca093cc316d57a734c3c08a6ebe7f723e044ed3..e1bcaddf9f61b0467353e08e28becae22abf2368 100644 (file)
@@ -213,6 +213,7 @@ namespace System.Reflection.Emit {
                        }
                        if (max_stack < cur_stack)
                                max_stack = cur_stack;
+
                        /* 
                         * Note that we adjust for the pop behaviour _after_ setting max_stack.
                         */
@@ -357,7 +358,7 @@ namespace System.Reflection.Emit {
                                add_token_fixup (constructor);
                        emit_int (token);
                        ParameterInfo[] mparams = constructor.GetParameters();
-                       if (mparams != null)
+                       if ((opcode.StackBehaviourPop == StackBehaviour.Varpop) && (mparams != null))
                                cur_stack -= mparams.Length;
                }
                public virtual void Emit (OpCode opcode, double val) {
@@ -517,7 +518,7 @@ namespace System.Reflection.Emit {
                        if (method.ReturnType != void_type)
                                cur_stack ++;
                        ParameterInfo[] mparams = method.GetParameters();
-                       if (mparams != null)
+                       if ((opcode.StackBehaviourPop == StackBehaviour.Varpop) && (mparams != null))
                                cur_stack -= mparams.Length;
                }
                [CLSCompliant(false)]