* mini.c (remove_block_if_useless): Do not remove the bblock immediately
after the end of a try bblock, to prevent asserts in mini_method_compile ().
* iltests.il: Add a test for the above.
svn path=/trunk/mono/; revision=61627
+2006-06-12 Zoltan Varga <vargaz@gmail.com>
+
+ * mini.c (remove_block_if_useless): Do not remove the bblock immediately
+ after the end of a try bblock, to prevent asserts in mini_method_compile ().
+
+ * iltests.il: Add a test for the above.
+
2006-06-10 Zoltan Varga <vargaz@gmail.com>
* mini-ia64.c (mono_arch_lowering_pass): Remove some code duplication.
ret
}
+ .method public static void try_block_end_remove_if_useless () cil managed {
+ .maxstack 8
+
+ T_START:
+ ldstr "Start"
+ pop
+ leave.s COMPLETE
+ T1_END:
+
+ COMPLETE:
+ ret
+
+ F1_START:
+ ldstr "Finally1"
+ pop
+ endfinally
+ F1_END:
+
+ .try T_START to T1_END finally handler F1_START to F1_END
+ }
+
+ .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
+ call void class Tests::try_block_end_remove_if_useless ()
+ ldc.i4.0
+ ret
+ }
}
if ((previous_bb == cfg->bb_entry) && (bb->next_bb != target_bb)) {
return FALSE;
}
+
+ /*
+ * Do not touch BBs following a try block as the code in
+ * mini_method_compile needs them to compute the length of the try block.
+ */
+ if (MONO_BBLOCK_IS_IN_REGION (previous_bb, MONO_REGION_TRY))
+ return FALSE;
/* Check that there is a target BB, and that bb is not an empty loop (Bug 75061) */
if ((target_bb != NULL) && (target_bb != bb)) {