From 8ce71f96194f32b9da3af7492518caf16928d850 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Thu, 26 Jan 2012 17:25:47 -0200 Subject: [PATCH] Fix aot miscompilation due to the lazy supertypes initialization. --- mono/mini/method-to-ir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 61aaecab69c..588ab361be9 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -1543,6 +1543,8 @@ mini_emit_isninst_cast_inst (MonoCompile *cfg, int klass_reg, MonoClass *klass, int stypes_reg = alloc_preg (cfg); int stype = alloc_preg (cfg); + mono_class_setup_supertypes (klass); + if (klass->idepth > MONO_DEFAULT_SUPERTABLE_SIZE) { MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, idepth_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, idepth)); MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, idepth_reg, klass->idepth); @@ -1678,6 +1680,8 @@ mini_emit_castclass_inst (MonoCompile *cfg, int obj_reg, int klass_reg, MonoClas int stypes_reg = alloc_preg (cfg); int stype = alloc_preg (cfg); + mono_class_setup_supertypes (klass); + if (klass->idepth > MONO_DEFAULT_SUPERTABLE_SIZE) { MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, idepth_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, idepth)); MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, idepth_reg, klass->idepth); -- 2.11.4.GIT