summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 16:44:57 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 16:44:57 (GMT)
commite35fe8d11b889a5646a23df06bbecf16f88c518a (patch)
treed4346b34db86ab7c09ccb2db3f0e2803664e9421 /load.c
parent15270f48a9f3ccd7e57798d7eff4dd8d5d83c259 (diff)
Revert "Revert "Manage AST NODEs out of GC""
This re-introduces r60485. This reverts commit 5a176b75b1187cbd3861c387bde65ff66396a07c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/load.c b/load.c
index db09c33..8b12c4d 100644
--- a/load.c
+++ b/load.c
@@ -602,7 +602,7 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
EC_PUSH_TAG(th->ec);
state = EXEC_TAG();
if (state == TAG_NONE) {
- NODE *node;
+ ast_t *ast;
const rb_iseq_t *iseq;
if ((iseq = rb_iseq_load_iseq(fname)) != NULL) {
@@ -611,9 +611,10 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
else {
VALUE parser = rb_parser_new();
rb_parser_set_context(parser, NULL, FALSE);
- node = (NODE *)rb_parser_load_file(parser, fname);
- iseq = rb_iseq_new_top(node, rb_fstring_cstr("<top (required)>"),
+ ast = (ast_t *)rb_parser_load_file(parser, fname);
+ iseq = rb_iseq_new_top(ast->root, rb_fstring_cstr("<top (required)>"),
fname, rb_realpath_internal(Qnil, fname, 1), NULL);
+ rb_ast_dispose(ast);
}
rb_iseq_eval(iseq);
}