Author: lupus
Date: 2007-12-11 01:44:34 -0500 (Tue, 11 Dec 2007)
New Revision: 91072
Modified:
branches/mono-1-2-6/mono/mono/mini/ChangeLog
branches/mono-1-2-6/mono/mono/mini/mini.c
Log:
Mon Dec 10 11:08:49 CET 2007 Paolo Molaro <[EMAIL PROTECTED]>
* mini.c: call type ctor before allocating objects of the type
(fixes at least part of bug #342507).
Modified: branches/mono-1-2-6/mono/mono/mini/ChangeLog
===================================================================
--- branches/mono-1-2-6/mono/mono/mini/ChangeLog 2007-12-10 22:46:05 UTC
(rev 91071)
+++ branches/mono-1-2-6/mono/mono/mini/ChangeLog 2007-12-11 06:44:34 UTC
(rev 91072)
@@ -1,3 +1,9 @@
+
+Mon Dec 10 11:08:49 CET 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+ * mini.c: call type ctor before allocating objects of the type
+ (fixes at least part of bug #342507).
+
2007-12-07 Mark Probst <[EMAIL PROTECTED]>
* mini.c: Don't compile methods with sharing enabled if their
Modified: branches/mono-1-2-6/mono/mono/mini/mini.c
===================================================================
--- branches/mono-1-2-6/mono/mono/mini/mini.c 2007-12-10 22:46:05 UTC (rev
91071)
+++ branches/mono-1-2-6/mono/mono/mini/mini.c 2007-12-11 06:44:34 UTC (rev
91072)
@@ -5882,6 +5882,16 @@
* will be transformed into a normal
call there.
*/
} else {
+ MonoVTable *vtable = mono_class_vtable
(cfg->domain, cmethod->klass);
+ if (mini_field_access_needs_cctor_run
(cfg, method, vtable) && !(g_slist_find (class_inits, vtable))) {
+ guint8 *tramp =
mono_create_class_init_trampoline (vtable);
+ mono_emit_native_call (cfg,
bblock, tramp,
+
helper_sig_class_init_trampoline,
+
NULL, ip, FALSE, FALSE);
+ if (cfg->verbose_level > 2)
+ g_print ("class %s.%s
needs init call for ctor\n", klass->name_space, klass->name);
+ class_inits = g_slist_prepend
(class_inits, vtable);
+ }
temp = handle_alloc (cfg, bblock,
cmethod->klass, FALSE, ip);
NEW_TEMPLOAD (cfg, *sp, temp);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches