[Mono-bugs] [Bug 74365][Wis] New - ILasm bugs

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 4 Apr 2005 07:14:36 -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 radical@gmail.com.


--- shadow/74365	2005-04-04 07:14:36.000000000 -0400
+++ shadow/74365.tmp.22690	2005-04-04 07:14:36.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 74365
+Product: Mono: Compilers
+Version: unspecified
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: IL assembler
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: radical@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: ILasm bugs
+Attached is a patch for bugs in ilasm.
+As almost all the fixes are on the same file (PEAPI.cs), it wont be
+possible to seperate them out.
+Also attached are test cases for reproducing the bugs fixed. These were
+discovered and fixed while trying to roundtripping on
+Microsoft.VisualBasic.dll (monodis ms.vb.dll > vb.il; ilasm /dll vb.il;
+PEVerify.exe vb.dll).
+After this patch, PEVerify gives zero errors on the final .dll.
+The major chunk is for fixing the handling of ValueTypes in ilasm.
+case.cs : 
+"ref <valuetype>" .. not encoded correctly. Change required in
+ClassRefInst.ctor, typeIndex(base) changed to a ValueType. (see patch)
+case2.cs : 
+ Two problems: 1. for array of ValueTypes
+               2. ClassRef to ValueType or Enum, gets encoded as a
+valuetype. It should be encoded as a ClassRef to System.ValueType or
+System.Enum. Only types derived from these are valuetypes.
+i1.il : 
+ IL allows method params to have same name. ilasm(mono) uses a hashtable to
+store named params.. changed that.
+i2.il : 
+ Type not set for a ByteArrConst (eg. when .param[1] = bytearray (...) )
+ByteArray is set to a string by default.
+i3.il :
+For a float method param
+      .param [1] = float64(0x3FB999999999999A)
+ILParser converts (0x3f...) to an int64 and then later tries to convert it
+into a float, instead of using the in64's exact bit image to build the float.
+For Nested classes, the entry in the TypeDef table for the nested class
+should have namespace="", as it is built from the NestedClass &
+EnclosingClass in the NestedClass table.