* metadata.c (mono_type_size): If we're a generic instance, call
mono_class_value_size() for value types.
svn path=/trunk/mono/; revision=33140
+2004-09-01 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_type_size): If we're a generic instance, call
+ mono_class_value_size() for value types.
+
2004-08-31 Zoltan Varga <vargaz@freemail.hu>
* marshal.c: Implement more custom marshalling functionality. Fixes
return mono_class_value_size (mono_defaults.typed_reference_class, align);
case MONO_TYPE_GENERICINST: {
MonoGenericInst *ginst = t->data.generic_inst;
- MonoClass *iclass = mono_class_from_mono_type (ginst->generic_type);
- return mono_type_size (&iclass->byval_arg, align);
+
+ if (MONO_TYPE_ISSTRUCT (ginst->generic_type))
+ return mono_class_value_size (ginst->klass, align);
+ else {
+ *align = __alignof__(gpointer);
+ return sizeof (gpointer);
+ }
}
case MONO_TYPE_VAR:
case MONO_TYPE_MVAR: