* class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to define size.
* domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
* metadata.h (MONO_SIZEOF_TYPE): Likewise.
* reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
svn path=/trunk/mono/; revision=139689
+2009-08-11 Raja R Harinath <harinath@hurrynot.org>
+
+ Fix incorrect size definitions where the tail array isn't a list
+ of pointers
+ * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
+ define size.
+ * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
+ * metadata.h (MONO_SIZEOF_TYPE): Likewise.
+ * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
+
2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
* reflection.h:
MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
} MonoMarshalType;
-#define MONO_SIZEOF_MARSHAL_TYPE (sizeof (MonoMarshalType) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+#define MONO_SIZEOF_MARSHAL_TYPE (offsetof (MonoMarshalType, fields))
struct _MonoProperty {
MonoClass *parent;
/* There is an optional MonoGenericJitInfo after the clauses */
};
-#define MONO_SIZEOF_JIT_INFO (sizeof (struct _MonoJitInfo) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+#define MONO_SIZEOF_JIT_INFO (offsetof (struct _MonoJitInfo, clauses))
struct _MonoAppContext {
MonoObject obj;
MonoCustomMod modifiers [MONO_ZERO_LEN_ARRAY]; /* this may grow */
};
-#define MONO_SIZEOF_TYPE (sizeof (struct _MonoType) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+#define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
/*
* This structure is an internal runtime detail: use the mono_signature_*
MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
} MonoCustomAttrInfo;
-#define MONO_SIZEOF_CUSTOM_ATTR_INFO (sizeof (MonoCustomAttrInfo) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
+#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs))
/*
* Information which isn't in the MonoMethod structure is stored here for