[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


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


           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: ---


Repro: 

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.AppDomain.CurrentDomain.DefineDynamicAssembly(name,
System.Reflection.Emit.AssemblyBuilderAccess.Save, ".");
                ModuleBuilder mod = ab.DefineDynamicModule("tester",
"tesster.dll", false);
                TypeBuilder tb = mod.DefineType ("T");
                MethodBuilder mb = tb.DefineMethod ("A",
MethodAttributes.Public);

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

                Mono.Cecil.Cil.MethodBody body = new Mono.Cecil.Cil.MethodBody
(null);
                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
/mono/head/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CilWorker.cs:117
  at Mono.Cecil.Cil.CilWorker.Emit (OpCode opcode, Int32 i) [0x00000] in
/mono/head/mcs/class/Mono.Cecil/Mono.Cecil.Cil/CilWorker.cs:239
  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