Takashi Kokubun 2019-08-04 08:38:37 +09:00
parent 7adc8c79ea
commit 326c00b6f8
No known key found for this signature in database
GPG Key ID: 6FFC433B12EE23DD
2 changed files with 3 additions and 4 deletions

View File

@ -5812,7 +5812,7 @@ yycompile(VALUE vparser, struct parser_params *p, VALUE fname, int line)
p->ruby_sourcefile = "(none)"; p->ruby_sourcefile = "(none)";
} }
else { else {
p->ruby_sourcefile_string = rb_fstring(fname); p->ruby_sourcefile_string = rb_str_new_frozen(fname);
p->ruby_sourcefile = StringValueCStr(fname); p->ruby_sourcefile = StringValueCStr(fname);
} }
p->ruby_sourceline = line - 1; p->ruby_sourceline = line - 1;
@ -9773,7 +9773,7 @@ gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
if (NIL_P(file)) if (NIL_P(file))
file = rb_str_new(0, 0); file = rb_str_new(0, 0);
else else
file = rb_str_dup(file); file = rb_str_dup(rb_fstring(file));
node = NEW_STR(add_mark_object(p, file), loc); node = NEW_STR(add_mark_object(p, file), loc);
} }
return node; return node;

View File

@ -1284,7 +1284,6 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind,
} }
if (fname != Qundef) { if (fname != Qundef) {
if (!NIL_P(fname)) fname = rb_fstring(fname);
realpath = fname; realpath = fname;
} }
else if (bind) { else if (bind) {
@ -1294,7 +1293,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind,
rb_parser_warn_location(parser, TRUE); rb_parser_warn_location(parser, TRUE);
} }
else { else {
fname = rb_fstring_lit("(eval)"); fname = rb_usascii_str_new_cstr("(eval)");
} }
rb_parser_set_context(parser, base_block, FALSE); rb_parser_set_context(parser, base_block, FALSE);