[Mono-bugs] [Bug 640702] New: MethodBase.GetCurrentMethod doesn't work inside a DynamicMethod

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 21 02:38:31 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=640702

https://bugzilla.novell.com/show_bug.cgi?id=640702#c0


           Summary: MethodBase.GetCurrentMethod doesn't work inside a
                    DynamicMethod
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jeroen at sumatra.nl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64;
Trident/5.0)

Repro:
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;

public class Program
{
    static void Main(string[] args)
    {
        DynamicMethod dm = new DynamicMethod("Foo", null, null);
        ILGenerator ilgen = dm.GetILGenerator();
        ilgen.Emit(OpCodes.Call,
typeof(MethodBase).GetMethod("GetCurrentMethod"));
        ilgen.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", new
Type[] { typeof(object) }));
        ilgen.Emit(OpCodes.Ret);
        ThreadStart del = (ThreadStart)dm.CreateDelegate(typeof(ThreadStart));
        del();
    }
}


Reproducible: Always

Steps to Reproduce:
Compile and run repro

Actual Results:  
Void Main(System.String[])

Expected Results:  
Void Foo()

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list