Author: zoltan
Date: 2005-03-24 13:00:11 -0500 (Thu, 24 Mar 2005)
New Revision: 42226
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/marshal.c
Log:
2005-03-24 Zoltan Varga <[EMAIL PROTECTED]>
* marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
profile.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2005-03-24 17:34:55 UTC (rev 42225)
+++ trunk/mono/mono/metadata/ChangeLog 2005-03-24 18:00:11 UTC (rev 42226)
@@ -1,5 +1,8 @@
2005-03-24 Zoltan Varga <[EMAIL PROTECTED]>
+ * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
+ profile.
+
* reflection.c (create_custom_attr): Allocate the params array using
alloca so it gets GC tracking.
Modified: trunk/mono/mono/metadata/marshal.c
===================================================================
--- trunk/mono/mono/metadata/marshal.c 2005-03-24 17:34:55 UTC (rev 42225)
+++ trunk/mono/mono/metadata/marshal.c 2005-03-24 18:00:11 UTC (rev 42226)
@@ -288,12 +288,14 @@
* construct it.
*/
cinfo = mono_custom_attrs_from_class (klass);
- attr =
(MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr
(cinfo, UnmanagedFunctionPointerAttribute);
- if (attr) {
- piinfo.piflags = (attr->call_conv << 8) |
(attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
+ if (cinfo) {
+ attr =
(MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr
(cinfo, UnmanagedFunctionPointerAttribute);
+ if (attr) {
+ piinfo.piflags = (attr->call_conv << 8)
| (attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
+ }
+ if (!cinfo->cached)
+ mono_custom_attrs_free (cinfo);
}
- if (!cinfo->cached)
- mono_custom_attrs_free (cinfo);
}
mspecs = g_new0 (MonoMarshalSpec*, mono_method_signature
(invoke)->param_count + 1);
@@ -6135,17 +6137,19 @@
* construct it.
*/
cinfo = mono_custom_attrs_from_class (delegate_klass);
- attr =
(MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr
(cinfo, UnmanagedFunctionPointerAttribute);
- if (attr) {
- memset (&piinfo, 0, sizeof (piinfo));
- m.piinfo = &piinfo;
- piinfo.piflags = (attr->call_conv << 8) |
(attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
+ if (cinfo) {
+ attr =
(MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr
(cinfo, UnmanagedFunctionPointerAttribute);
+ if (attr) {
+ memset (&piinfo, 0, sizeof (piinfo));
+ m.piinfo = &piinfo;
+ piinfo.piflags = (attr->call_conv << 8) |
(attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
+ }
+ if (!cinfo->cached)
+ mono_custom_attrs_free (cinfo);
+
+ /* FIXME: modify the calling convention */
+ g_assert_not_reached ();
}
- if (!cinfo->cached)
- mono_custom_attrs_free (cinfo);
-
- /* FIXME: modify the calling convention */
- g_assert_not_reached ();
}
/* fixme: howto handle this ? */
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches