Bug 317831 (MONO74768) - [PATCH] ilasm bugs
Summary: [PATCH] ilasm bugs
Status: RESOLVED FIXED
Alias: MONO74768
Product: Mono: Compilers
Classification: Mono
Component: IL assembler (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Jackson Harper
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-29 12:34 UTC by Jain Ankit
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
test case (d.il) (2.56 KB, text/plain)
2005-04-29 12:36 UTC, Thomas Wiest
Details
Patch (1.55 KB, patch)
2005-04-29 12:36 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:15:14 UTC


---- Reported by radical@gmail.com 2005-04-29 05:34:40 MST ----

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.



---- Additional Comments From radical@gmail.com 2005-04-29 05:36:26 MST ----

Created an attachment (id=167821)
test case (d.il)




---- Additional Comments From radical@gmail.com 2005-04-29 05:36:57 MST ----

Created an attachment (id=167822)
Patch




---- Additional Comments From radical@gmail.com 2005-04-29 05:38:52 MST ----

The patch was a hack done with Hari.



---- Additional Comments From radical@gmail.com 2005-05-10 02:21:45 MST ----

Fixed in SVN.

Imported an attachment (id=167821)
Imported an attachment (id=167822)

Unknown operating system unknown. Setting to default OS "Other".