diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-25 03:41:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-25 03:41:43 +0000 |
commit | c0baa381b5293abfe2c06a5ecdf10551c05c92f9 (patch) | |
tree | 5d513a04296ef50aea6a7c7f818c15845355fa74 /compile.c | |
parent | ed3a575b594ad734b403f7ffc4f100cae707604c (diff) | |
download | ruby-c0baa381b5293abfe2c06a5ecdf10551c05c92f9.tar.gz |
compile.c: unreachable chunk
* compile.c (iseq_peephole_optimize): remove unreachable chunk
which appeared by useless jump elimination.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2168,6 +2168,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal */ 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, LINK_ELEMENT *list, const int do_tailcal ? 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, LINK_ELEMENT *list, const int do_tailcal 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; } } |