summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y12
1 files changed, 7 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index 0945560aa09..153f669514d 100644
--- a/parse.y
+++ b/parse.y
@@ -5356,9 +5356,13 @@ ruby_parser_stack_on_heap()
void
rb_gc_mark_parser()
{
- if (ruby_in_compile) {
- rb_gc_mark_maybe((VALUE)yylval.node);
- }
+ if (!ruby_in_compile) return;
+
+ rb_gc_mark_maybe((VALUE)yylval.node);
+ rb_gc_mark((VALUE)ruby_eval_tree_begin);
+ rb_gc_mark((VALUE)ruby_eval_tree);
+ rb_gc_mark((VALUE)lex_lastline);
+ rb_gc_mark((VALUE)lex_strterm);
}
void
@@ -5443,8 +5447,6 @@ Init_sym()
{
sym_tbl = st_init_strtable_with_size(200);
sym_rev_tbl = st_init_numtable_with_size(200);
- rb_global_variable((VALUE*)&lex_lastline);
- rb_global_variable((VALUE*)&lex_strterm);
}
static ID last_id = LAST_TOKEN;