summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-02 20:16:02 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-02 20:16:02 +0000
commit6f73c38791bc559eddd6929fc6d0153efd9f7b95 (patch)
treecc74cbf14d77475e741ed9e0e13eb58773afa1be /compile.c
parentec8e4c6afc1e462342e3b829e8bae02917788814 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 81cbb9ff5a..ab0dbf70ea 100644
--- a/compile.c
+++ b/compile.c
@@ -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);