for (i = 0; i < header->num_clauses; ++i) {
clause = &header->clauses [i];
if (MONO_OFFSET_IN_CLAUSE (clause, bb->real_offset)) {
- if (clause->data.catch_class && mono_class_is_assignable_from (clause->data.catch_class, exclass)) {
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE && clause->data.catch_class && mono_class_is_assignable_from (clause->data.catch_class, exclass)) {
MonoBasicBlock *tbb;
/* get the basic block for the handler and
* Flag is set during method_to_ir due to
* pop-op is optmized away in codegen (burg).
*/
- tbb = g_hash_table_lookup (cfg->bb_hash, header->code + clause->handler_offset);
+ tbb = cfg->cil_offset_to_bb [clause->handler_offset];
if (tbb && tbb->flags & BB_EXCEPTION_DEAD_OBJ && !(tbb->flags & BB_EXCEPTION_UNSAFE)) {
MonoBasicBlock *targetbb = tbb;
gboolean unsafe = FALSE;
/* Create dummy inst to allow easier integration in
* arch dependent code (opcode ignored)
*/
- MONO_INST_NEW (cfg, jump, CEE_BR);
+ MONO_INST_NEW (cfg, jump, OP_BR);
/* Allocate memory for our branch target */
jump->inst_i1 = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst));
return NULL;
}
+ } else {
+ /* Branching to an outer clause could skip inner clauses */
+ return NULL;
}
}
}