[Mono-bugs] [Bug 350606] New: Can't emit ldarga

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 24 08:57:06 EST 2007


           Summary: Can't emit ldarga
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Cecil
        AssignedTo: jbevain at novell.com
        ReportedBy: rkvinge at novell.com
         QAContact: mono-bugs at ximian.com
          Found By: ---


using System;
using Mono.Cecil.Cil;
using System.Reflection;
using System.Reflection.Emit;

class c {
        static void Main () {
                AssemblyName name = new AssemblyName ();
                name.Name = "tester";
                AssemblyBuilder ab =
System.Reflection.Emit.AssemblyBuilderAccess.Save, ".");
                ModuleBuilder mod = ab.DefineDynamicModule("tester",
"tesster.dll", false);
                TypeBuilder tb = mod.DefineType ("T");
                MethodBuilder mb = tb.DefineMethod ("A",

                ILGenerator il = mb.GetILGenerator ();
                il.Emit (System.Reflection.Emit.OpCodes.Ldarga, (short) 1);

                Mono.Cecil.Cil.MethodBody body = new Mono.Cecil.Cil.MethodBody
                CilWorker cw = body.CilWorker;
                cw.Emit (Mono.Cecil.Cil.OpCodes.Ldarga, (short) 1);


Results in:
rolf at linux:~/test> mono --debug c2.exe

Unhandled Exception: System.ArgumentException: opcode
  at Mono.Cecil.Cil.CilWorker.Create (OpCode opcode, Int32 i) [0x00026] in
  at Mono.Cecil.Cil.CilWorker.Emit (OpCode opcode, Int32 i) [0x00000] in
  at c.Main () [0x00000]

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

More information about the mono-bugs mailing list