[Mono-bugs] [Bug 71953][Wis] New - ILASM off-by-one when referring to named arguments

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 29 Jan 2005 18:01:06 -0500 (EST)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tonyg@kcbbs.gen.nz.


--- shadow/71953	2005-01-29 18:01:06.000000000 -0500
+++ shadow/71953.tmp.32242	2005-01-29 18:01:06.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 71953
+Product: Mono: Compilers
+Version: 1.0
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: IL assembler
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tonyg@kcbbs.gen.nz               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: ILASM off-by-one when referring to named arguments
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Non-static methods that have a parameter declaration, say "void
+MyMethod(object x) cil managed", and that use the parameter *by name*, eg
+"ldarg x", get instructions equivalent to "ldarg 0" emitted instead of the
+expected "ldarg 1".
+Steps to reproduce the problem:
+1. define a virtual, nonvirtual, or constructor instance method
+2. make it have a named argument in addition to the implicit 'this' param
+3. use 'ldarg theArgName'
+Actual Results:
+ldarg 0 emitted (confirmed by monodis)
+Expected Results:
+ldarg 1 emitted (tested against MS.NET ILASM, confirmed using monodis on
+the MS.NET-generated code)
+How often does this happen? 
+Additional Information:
+I'll attach a file of .IL that exhibits the problem. Disassembling the file
+as compiled by Mono's ILASM produces ldarg 0 for all the methods in the
+file; disassembly from MS.NET's ILASM produces ldarg 1 for all the instance
+methods, including the .ctor, and ldarg 0 for the static method, as expected.