diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-02 20:16:02 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-02 20:16:02 +0000 |
commit | 6f73c38791bc559eddd6929fc6d0153efd9f7b95 (patch) | |
tree | cc74cbf14d77475e741ed9e0e13eb58773afa1be /compile.c | |
parent | ec8e4c6afc1e462342e3b829e8bae02917788814 (diff) |
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
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |