diff --git a/ChangeLog b/ChangeLog index 5049145058..08c6ed01c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Sep 8 18:13:13 2008 Tanaka Akira + + * vm.c (rb_mRubyVMFrozenCore): registered for GC. + + * re.c (rb_reg_preprocess_dregexp): fix GC problem on MacOS X with + powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. + build 5367). + Mon Sep 8 18:09:07 2008 NAKAMURA Usaku * win32/Makefile.sub (config.h): define SIZE_MAX for VC++6/7. diff --git a/re.c b/re.c index de7ebeb41b..a17874ab71 100644 --- a/re.c +++ b/re.c @@ -2249,15 +2249,13 @@ rb_reg_preprocess_dregexp(VALUE ary) onig_errmsg_buffer err = ""; int i; VALUE result = 0; - int argc = RARRAY_LEN(ary); - VALUE *argv = RARRAY_PTR(ary); - if (argc == 0) { + if (RARRAY_LEN(ary) == 0) { rb_raise(rb_eArgError, "no arguments given"); } - for (i = 0; i < argc; i++) { - VALUE str = argv[i]; + for (i = 0; i < RARRAY_LEN(ary); i++) { + VALUE str = RARRAY_PTR(ary)[i]; VALUE buf; char *p, *end; rb_encoding *src_enc; diff --git a/vm.c b/vm.c index b39db29de9..71658195b1 100644 --- a/vm.c +++ b/vm.c @@ -1820,6 +1820,7 @@ Init_VM(void) rb_define_method_id(klass, id_core_define_singleton_method, m_core_define_singleton_method, 3); rb_define_method_id(klass, id_core_set_postexe, m_core_set_postexe, 1); rb_obj_freeze(fcore); + rb_global_variable(&rb_mRubyVMFrozenCore); rb_mRubyVMFrozenCore = fcore; /* ::VM::Env */