diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-10-26 01:58:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 01:58:01 +0900 |
commit | 09fa773e04f183e5eb685f07e174efa2cf77f9dc (patch) | |
tree | 43b58901056217443ddfcee79decd2a9c71596cc /parse.y | |
parent | 33113c6b64b9017e8b31b6c5e9cbcd7bdf30f05a (diff) |
ast.c: Use kept script_lines data instead of re-opening the source file (#5019)
ast.c: Use kept script_lines data instead of re-open the source file
Notes
Notes:
Merged-By: mame <mame@ruby-lang.org>
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -6414,6 +6414,7 @@ lex_getline(struct parser_params *p) VALUE line = (*p->lex.gets)(p, p->lex.input); if (NIL_P(line)) return line; must_be_ascii_compatible(line); + if (RB_OBJ_FROZEN(line)) line = rb_str_dup(line); // needed for RubyVM::AST.of because script_lines in iseq is deep-frozen #ifndef RIPPER if (p->debug_lines) { rb_enc_associate(line, p->enc); |