Skip to content

Commit

Permalink
[mono] Disable the remove empty finally pass for now. (#53710)
Browse files Browse the repository at this point in the history
It cannot determine whenever the finally clause is really empty, i.e. whenever
it can affect the rest of the program.

Fixes #53697.
  • Loading branch information
vargaz authored Jun 4, 2021
1 parent 7f5265a commit 0d7c498
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,7 @@ mono_insert_branches_between_bblocks (MonoCompile *cfg)
}
}

static void
static G_GNUC_UNUSED void
remove_empty_finally_pass (MonoCompile *cfg)
{
MonoBasicBlock *bb;
Expand Down Expand Up @@ -2918,6 +2918,7 @@ remove_empty_finally_pass (MonoCompile *cfg)
break;
}
MONO_BB_FOR_EACH_INS (bb, ins) {
// FIXME: OP_MOVE has no side effect, but it can still modify state
if (!(ins->opcode == OP_START_HANDLER || ins->opcode == OP_ENDFINALLY || MONO_INS_HAS_NO_SIDE_EFFECT (ins))) {
empty = FALSE;
break;
Expand Down Expand Up @@ -3582,7 +3583,8 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
mono_cfg_dump_ir (cfg, "if_conversion");
}

remove_empty_finally_pass (cfg);
// See the FIXME in the function
//remove_empty_finally_pass (cfg);

mono_threads_safepoint ();

Expand Down

0 comments on commit 0d7c498

Please sign in to comment.