compile.c: avoid duplicate mark entry for string literal Range

iseq_add_mark_object is called in iseq_set_sequence later on,
so we only need to call iseq_add_mark_object_compile_time
in iseq_peephole_optimize.  Without this change, there would've
been a duplicate entry in the long-lived iseq mark_ary.

* compile.c (iseq_peephole_optimize): avoid duplicate mark object entry
  [ruby-core:80536] [Feature #13355]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2017-04-02 20:16:02 +00:00
Родитель ec8e4c6afc
Коммит 6f73c38791
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2167,7 +2167,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
int excl = FIX2INT(OPERAND_AT(range, 0));
VALUE lit_range = rb_range_new(str_beg, str_end, excl);
iseq_add_mark_object(iseq, lit_range);
iseq_add_mark_object_compile_time(iseq, lit_range);
REMOVE_ELEM(&beg->link);
REMOVE_ELEM(&end->link);
range->insn_id = BIN(putobject);