diff options
author | Yusuke Endoh <[email protected]> | 2021-06-18 01:31:50 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2021-06-18 02:34:27 +0900 |
commit | fb01411ae842dbcc16d18dec2216fa2719649dff (patch) | |
tree | e8dcf2550a7aa8c5579a86b2623b00b96d6f8f8c /parse.y | |
parent | acae5f363dfaedd9c2873cee68c9498da3c072f5 (diff) |
node.h: Reduce struct size to fit with Ruby object size (five VALUEs)
by merging `rb_ast_body_t#line_count` and `#script_lines`.
Fortunately `line_count == RARRAY_LEN(script_lines)` was always
satisfied. When script_lines is saved, it has an array of lines, and
when not saved, it has a Fixnum that represents the old line_count.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4581
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -6286,7 +6286,7 @@ yycompile0(VALUE arg) RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt); } p->ast->body.root = tree; - p->ast->body.line_count = p->line_count; + if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count); return TRUE; } |