diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-03 13:41:55 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-03 13:48:29 +0900 |
commit | 5931857281ce45c1c277aa86d1588119ab00a955 (patch) | |
tree | 3c2dc33435d53b602b7532e25e3ced7c0dde6dee /parse.y | |
parent | 688a59f8ac984a2f1d4d53005dbe0679dcd59ac3 (diff) | |
download | ruby-5931857281ce45c1c277aa86d1588119ab00a955.tar.gz |
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.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5812,7 +5812,7 @@ yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line) 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) 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; |