summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 03:36:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-12 03:36:49 +0000
commit014623db85535502613ace031857000b06543e90 (patch)
tree8c8b3ce8575b17c778a2ab67a2e893ac8af6d3b4 /gc.c
parent95458ae6d610a7b98d7c5de73c352e4cce4c0871 (diff)
downloadruby-014623db85535502613ace031857000b06543e90.tar.gz
ruby-014623db85535502613ace031857000b06543e90.tar.xz
ruby-014623db85535502613ace031857000b06543e90.zip
precedes registering global VALUE variables before initializing it.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index d076898fd..c172a0841 100644
--- a/gc.c
+++ b/gc.c
@@ -1053,7 +1053,9 @@ gc_sweep()
}
mark_source_filename(ruby_sourcefile);
- st_foreach(source_filenames, sweep_source_filename, 0);
+ if (source_filenames) {
+ st_foreach(source_filenames, sweep_source_filename, 0);
+ }
freelist = 0;
final_list = deferred_final_list;
@@ -1938,6 +1940,6 @@ Init_GC()
source_filenames = st_init_strtable();
- nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory");
rb_global_variable(&nomem_error);
+ nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory");
}