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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=75479 --- shadow/75479 2005-12-08 13:35:30.000000000 -0500 +++ shadow/75479.tmp.3362 2006-02-14 08:27:22.000000000 -0500 @@ -4,20 +4,19 @@ OS: unknown OS Details: amd64 pld linux Status: NEW Resolution: Severity: Unknown Priority: Normal -Component: GC +Component: misc AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: --- URL: -Cc: -Summary: [GMCS] GC is confused by generic structs +Summary: mono_class_from_mono_type()/mono_type_get_underlying_type() and generics Description of Problem: The following testcase: #v+ @@ -242,6 +241,32 @@ ------- Additional Comments From [EMAIL PROTECTED] 2005-12-08 13:35 ------- Thanks a lot for wasting yet another afternoon on this. I checked get_underlying_type() everywhere and it's correct everywhere. Considering the amout on time already spent on this bug (3.5 days), I have no other choice but close it as WONTFIX if it ever bounces back to me. + +------- Additional Comments From [EMAIL PROTECTED] 2006-02-14 08:27 ------- +The issue exposed by the test case can be 'fixed' with this temporary +patch: +--- metadata/class.c (revision 56832) ++++ metadata/class.c (working copy) +@@ -983,7 +984,7 @@ + + if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) { + ftype = mono_type_get_underlying_type (field->type); +- if (MONO_TYPE_IS_REFERENCE (ftype) || IS_GC_REFERENCE (ftype) || +((MONO_TYPE_ISSTRUCT (ftype) && mono_class_has_references +(mono_class_from_mono_type (ftype))))) ++ if (MONO_TYPE_IS_REFERENCE (ftype) || IS_GC_REFERENCE (ftype) || +((MONO_TYPE_ISSTRUCT (ftype) && mono_class_has_references +(mono_class_from_mono_type (field->type))))) + class->has_references = TRUE; + } + } + +The problem here is that mono_type_get_underlying_type() will return +a broken type pointer, at least in the case of an instantiated generic +struct. The low-level type is MONO_TYPE_VALUETYPE, but the MonoClass* +pointer in it points to the uninstantiated generic struct and not the +correct instantiated one, so when mono_class_from_mono_type() is +called on it it gets the wrong info. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
