[前][次][番号順一覧][スレッド一覧]

ruby-changes:56799

From: Takashi <ko1@a...>
Date: Sun, 4 Aug 2019 10:11:57 +0900 (JST)
Subject: [ruby-changes:56799] Takashi Kokubun: a3188f43a8 (master): Revert "Revert "Fix dangling path name from fstring""

https://git.ruby-lang.org/ruby.git/commit/?id=a3188f43a8

From a3188f43a812a8c3954391af66ed54352423ef60 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 4 Aug 2019 10:08:17 +0900
Subject: Revert "Revert "Fix dangling path name from fstring""

This reverts commit 326c00b6f89e1c86e6fe29ab60da593eb6883a88.

We also confirmed that test_gced_eval_location fails without the changes:
https://travis-ci.org/ruby/ruby/builds/567417818
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20190804T000003Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20190804T003005Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20190804T000007Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-master/log/20190804T001806Z.fail.html.gz
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian9/ruby-master/log/20190804T003005Z.fail.html.gz

diff --git a/parse.y b/parse.y
index 3bff42a..de2a922 100644
--- a/parse.y
+++ b/parse.y
@@ -5812,7 +5812,7 @@ yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line) https://github.com/ruby/ruby/blob/trunk/parse.y#L5812
 	p->ruby_sourcefile = "(none)";
     }
     else {
-	p->ruby_sourcefile_string = rb_str_new_frozen(fname);
+	p->ruby_sourcefile_string = rb_fstring(fname);
 	p->ruby_sourcefile = StringValueCStr(fname);
     }
     p->ruby_sourceline = line - 1;
@@ -9773,7 +9773,7 @@ gettable(struct parser_params *p, ID id, const YYLTYPE *loc) https://github.com/ruby/ruby/blob/trunk/parse.y#L9773
 	    if (NIL_P(file))
 		file = rb_str_new(0, 0);
 	    else
-		file = rb_str_dup(rb_fstring(file));
+		file = rb_str_dup(file);
 	    node = NEW_STR(add_mark_object(p, file), loc);
 	}
 	return node;
diff --git a/vm_eval.c b/vm_eval.c
index eb728c0..222389e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1284,6 +1284,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1284
     }
 
     if (fname != Qundef) {
+        if (!NIL_P(fname)) fname = rb_fstring(fname);
 	realpath = fname;
     }
     else if (bind) {
@@ -1293,7 +1294,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1294
 	rb_parser_warn_location(parser, TRUE);
     }
     else {
-        fname = rb_usascii_str_new_cstr("(eval)");
+        fname = rb_fstring_lit("(eval)");
     }
 
     rb_parser_set_context(parser, base_block, FALSE);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]