summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2021-05-20 19:13:39 +0900
committerYusuke Endoh <[email protected]>2021-05-20 19:13:39 +0900
commit5026f9a5d5012248729a0052cd6cec811748291b (patch)
treeb88b850fe54c2b49b2778bcdd15b273c12bb3fb4 /compile.c
parent821e3c128f8e9efce9dbd2b1b96abc22d0312a60 (diff)
compile.c: stop the jump-jump optimization if the second has any event
Fixes [Bug #17868]
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index a9c2f96781..e8bb023b78 100644
--- a/compile.c
+++ b/compile.c
@@ -2926,7 +2926,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
}
else if (iobj != diobj && IS_INSN(&diobj->link) &&
IS_INSN_ID(diobj, jump) &&
- OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
+ OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0) &&
+ diobj->insn_info.events == 0) {
/*
* useless jump elimination:
* jump LABEL1