[Mono-bugs] [Bug 74768][Nor] New - [PATCH] ilasm bugs (
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 29 Apr 2005 05:34:41 -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.
http://bugzilla.ximian.com/show_bug.cgi?id=74768
--- shadow/74768 2005-04-29 05:34:41.000000000 -0400
+++ shadow/74768.tmp.9079 2005-04-29 05:34:41.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 74768
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: IL assembler
+AssignedTo: jackson@ximian.com
+ReportedBy: radical@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [PATCH] ilasm bugs (
+
+2 (related) Bugs:
+
+1. if you have a
+
+ isinst [mscorlib]System.Decimal
+ ....some code ...
+ call float64 valuetype [mscorlib]System.Decimal::op_Explicit(valuetype
+[mscorlib]System.Decimal)
+
+ Basically, the parser first sees System.Decimal, creates a typeref for
+that but not as a valuetype. Then when it meets System.Decimal again at the
+call site, it knows that its a valuetype this time, but since we are
+avoiding duplicates by using a hashtable, it just gets back the old object
+.. which was NOT set to a valuetype. So, this time we set it. Thats in
+ExternTypeRef.
+
+ 2. Basically, we are creating duplicate TypeSpec entries for valuetypes.
+(patch: ILParser.jay). So to fix that we dont create ExternTypeRefInst at
+all. Removing that also means that now we'll be emitting TypeRefs for such
+valuetypes.
+
+ Unpatched:
+
+ $ monodis --typespec d.exe
+ Typespec Table
+ 1: object
+ 2: valuetype [mscorlib]System.Decimal ####
+ 3: valuetype [mscorlib]System.Decimal ####
+ 4: int32
+
+Patched,
+
+$ monodis --typespec d.exe
+Typespec Table
+1: object
+
+$ monodis --typeref d.exe
+Typeref Table
+1: [mscorlib]System.Object
+2: [mscorlib]System.Decimal ######
+3: [mscorlib]System.Type
+4: [mscorlib]System.Console
+5: [mscorlib]System.Int32
+
+BTW, after this patch ExternTypeRefInst and ClassRefInst arent being used
+anywhere, so maybe we can get rid of 'em.