1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2002-08-27 11:00:24 +00:00
parent 087f010ddb
commit a13ebdb836
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Tue Aug 27 19:50:27 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ruby.c (require_libraries): prevent ruby_sorcefile from GC.
Tue Aug 27 15:03:35 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* file.c (rb_find_file): $LOAD_PATH must not be empty.

10
ruby.c
View file

@ -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