MONO_NEW_LABEL (s, dont_throw);
- MONO_EMIT_NEW_BIALU (s, OP_COMPARE, 0, state->left->reg1, state->right->reg1);
- MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, dont_throw);
+ /*
+ * Currently, we allways rethrow the abort exception, despite the fact
+ * that this is not correct. See thread6.cs for an example. But propagating
+ * the abort exception is more important than getting the sematics right.
+ */
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, dont_throw);
MONO_EMIT_UNALU (s, tree, CEE_THROW, -1, state->left->reg1);
mono_bblock_add_inst (s->cbb, dont_throw);
}
MONO_EMIT_NEW_LOAD_MEMBASE (s, eclass_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, cast_class));
if (klass->cast_class == mono_defaults.object_class) {
int parent_reg = mono_regstate_next_int (s->rs);
- int const_reg;
+ int const_reg = -1;
MONO_EMIT_NEW_LOAD_MEMBASE (s, parent_reg, eclass_reg, G_STRUCT_OFFSET (MonoClass, parent));
if (s->compile_aot) {
const_reg = mono_regstate_next_int (s->rs);
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, false_label);
} else if (klass->cast_class == mono_defaults.enum_class->parent) {
- int const_reg;
+ int const_reg = -1;
if (s->compile_aot) {
const_reg = mono_regstate_next_int (s->rs);
MONO_EMIT_NEW_LOAD_MEMBASE (s, eclass_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, cast_class));
if (klass->cast_class == mono_defaults.object_class) {
int parent_reg = mono_regstate_next_int (s->rs);
- int const_reg;
+ int const_reg = -1;
MONO_EMIT_NEW_LOAD_MEMBASE (s, parent_reg, eclass_reg, G_STRUCT_OFFSET (MonoClass, parent));
if (s->compile_aot) {
const_reg = mono_regstate_next_int (s->rs);