diff options
-rw-r--r-- | compile.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2942,6 +2942,15 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal else if (previ == BIN(newarray) && iseq_pop_newarray(iseq, (INSN*)prev)) { ELEM_REMOVE(&iobj->link); } + else if (previ == BIN(concatstrings)) { + if (OPERAND_AT(prev, 0) == INT2FIX(1)) { + ELEM_REMOVE(prev); + } + else { + ELEM_REMOVE(&iobj->link); + INSN_OF(prev) = BIN(adjuststack); + } + } } } |