[Mono-bugs] [Bug 74914][Nor] New - Classes from System.Reflection.Emit do not return correct Token values

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 11 May 2005 20:12:17 -0400 (EDT)


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 lluis@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=74914

--- shadow/74914	2005-05-11 20:12:17.000000000 -0400
+++ shadow/74914.tmp.28488	2005-05-11 20:12:17.000000000 -0400
@@ -0,0 +1,39 @@
+Bug#: 74914
+Product: Mono: Compilers
+Version: 1.1
+OS: SUSE 9.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lluis@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Classes from System.Reflection.Emit do not return correct Token values
+
+When creating a type using S.R.E., the methods MethodBuilder.GetToken() and
+ConstructorBuilder.GetToken() are not always returning correct values.
+
+The attached test case creates a class and defines a method and a
+constructor, then it prints the tokens for both of them retrieved with the
+GetToken() and saves the assembly. I get the following output:
+
+method: 6000001
+ctor: 6000002
+
+However, if I open the generated assembly (TestAssembly.dll) with a
+disassembler, I can see that the constructor has the 6000001 token
+assigned, and the method has 6000002. The same assembly generated with
+MS.NET has the correct values.
+
+Notice that if you change the test case so that the constructor is
+generated before the method, then the generated tokens are the correct ones.
+
+Due to this bug the methods for generating debug info (not yet committed)
+are not working properly (tested with ikvm and boo compilers), since the
+debug info gets liked to the wrong token.