ruby-changes:47540
From: nobu <ko1@a...>
Date: Fri, 25 Aug 2017 12:42:01 +0900 (JST)
Subject: [ruby-changes:47540] nobu:r59656 (trunk): compile.c: unreachable chunk
nobu 2017-08-25 12:41:43 +0900 (Fri, 25 Aug 2017) New Revision: 59656 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59656 Log: compile.c: unreachable chunk * compile.c (iseq_peephole_optimize): remove unreachable chunk which appeared by useless jump elimination. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 59655) +++ compile.c (revision 59656) @@ -2168,6 +2168,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2168 */ unref_destination(iobj, 0); REMOVE_ELEM(&iobj->link); + return COMPILE_OK; } else if (iobj != diobj && IS_INSN_ID(diobj, jump) && OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) { @@ -2229,6 +2230,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2230 ? BIN(branchunless) : BIN(branchif); replace_destination(piobj, iobj); REMOVE_ELEM(&iobj->link); + return COMPILE_OK; } else if (diobj == pdiobj) { /* @@ -2249,7 +2251,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2251 REPLACE_ELEM(&piobj->link, &popiobj->link); } } - else if (remove_unreachable_chunk(iseq, iobj->link.next)) { + if (remove_unreachable_chunk(iseq, iobj->link.next)) { goto again; } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/