From 71b0d20f7ea6b04aa3ae3fe6e624305a3ac294e6 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 24 Oct 2018 10:38:39 +0000 Subject: compile.c: fix peephole optimization * compile.c (iseq_peephole_optimize): should `pop` before jump instruction which succeeds to `newarray` of a literal object, not after. [ruby-core:89536] [Bug #15245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 7a013b893c..3d3e16e638 100644 --- a/compile.c +++ b/compile.c @@ -2913,7 +2913,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal } else if (!iseq_pop_newarray(iseq, pobj)) { pobj = new_insn_core(iseq, pobj->insn_info.line_no, BIN(pop), 0, NULL); - ELEM_INSERT_NEXT(&iobj->link, &pobj->link); + ELEM_INSERT_PREV(&iobj->link, &pobj->link); } if (cond) { if (prev_dup) { -- cgit v1.2.3