From a93a2f88d277b14818d0240ef48f2f2311933d2e Mon Sep 17 00:00:00 2001 From: nagachika Date: Wed, 7 Aug 2019 13:05:00 +0000 Subject: merge revision(s) 5931857281ce45c1c277aa86d1588119ab00a955,76e2370f132f83c16c9de39a0a9356579f364527: [Backport #16041] Fix dangling path name from fstring * parse.y (yycompile): make sure in advance that the `__FILE__` object shares a fstring, to get rid of dangling path name. Fixed up 53e9908d8afc7f03109b0aafd1698ab35f512b05. [Bug #16041] * vm_eval.c (eval_make_iseq): ditto. Fix dangling path name from fstring * load.c (rb_require_internal): make sure in advance that the path to be loaded shares a fstring, to get rid of dangling path name. Fixed up 5931857281ce45c1c277aa86d1588119ab00a955. [Bug #16041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 0e7047af65..e759197182 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1266,6 +1266,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, } if (fname != Qundef) { + if (!NIL_P(fname)) fname = rb_fstring(fname); realpath = fname; } else if (bind) { @@ -1275,7 +1276,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, 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 v1.2.3