Bugzilla – Bug 317831
[PATCH] ilasm bugs
Last modified: 2007-09-15 21:24:23 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".