summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-27 11:00:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-27 11:00:24 +0000
commita13ebdb8364025f15352670431d1f6db34f9df30 (patch)
treedc30ae729d093609c4849763db2e124a16725611 /ruby.c
parent087f010ddbbfaf6f16a18c4ab00500005b633d8d (diff)
* ruby.c (require_libraries): prevent ruby_sorcefile from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index 76ed2aa..8aa20ce 100644
--- a/ruby.c
+++ b/ruby.c
@@ -310,15 +310,14 @@ require_libraries()
{
extern NODE *ruby_eval_tree;
extern NODE *ruby_eval_tree_begin;
- char *orig_sourcefile = ruby_sourcefile;
- NODE *save[2];
+ NODE *save[3];
struct req_list *list = req_list_head.next;
struct req_list *tmp;
Init_ext(); /* should be called here for some reason :-( */
- ruby_sourcefile = 0;
save[0] = ruby_eval_tree;
save[1] = ruby_eval_tree_begin;
+ save[2] = NEW_NEWLINE(0);
ruby_eval_tree = ruby_eval_tree_begin = 0;
req_list_last = 0;
while (list) {
@@ -331,7 +330,10 @@ require_libraries()
req_list_head.next = 0;
ruby_eval_tree = save[0];
ruby_eval_tree_begin = save[1];
- ruby_sourcefile = orig_sourcefile;
+ ruby_current_node = save[2];
+ ruby_set_current_source();
+ ruby_current_node = 0;
+ rb_gc_force_recycle((VALUE)save[2]);
}
static void