From cbb56e30a4bc3d0f1446bdd3fb41f14a362e94fb Mon Sep 17 00:00:00 2001 From: tmm1 Date: Tue, 26 Nov 2013 23:30:25 +0000 Subject: * compile.c: Use rb_fstring() to de-duplicate string literals in code. [ruby-core:58599] [Bug #9159] [ruby-core:54405] * iseq.c (prepare_iseq_build): De-duplicate iseq labels and source locations. * re.c (rb_reg_initialize): Use rb_fstring() for regex string. * string.c (rb_fstring): Handle non-string and already-fstr arguments. * vm_eval.c (eval_string_with_cref): De-duplicate eval source filename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 2db1d3be56..df1c16132f 100644 --- a/iseq.c +++ b/iseq.c @@ -264,8 +264,10 @@ prepare_iseq_build(rb_iseq_t *iseq, OBJ_WRITE(iseq->self, &iseq->klass, 0); set_relation(iseq, parent); - OBJ_FREEZE(name); - OBJ_FREEZE(path); + name = rb_fstring(name); + path = rb_fstring(path); + if (RTEST(absolute_path)) + absolute_path = rb_fstring(absolute_path); iseq_location_setup(iseq, path, absolute_path, name, first_lineno); if (iseq != iseq->local_iseq) { -- cgit v1.2.3