From 3ba3860f582bbe034e54088cb9c785fc0e64a85f Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 10 Sep 2006 00:18:39 +0000 Subject: * eval.c (rb_require_safe): prevent extension from loading twice. fixed: [ruby-dev:29523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++- eval.c | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1a988249b..373c3fb8c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,10 @@ -Sun Sep 10 09:08:40 2006 Nobuyoshi Nakada +Tue Jan 10 09:18:03 2006 Nobuyoshi Nakada * eval.c (stack_extend): fixed prototype. + * eval.c (rb_require_safe): prevent extension from loading twice. + fixed: [ruby-dev:29523] + Sat Sep 9 23:50:38 2006 Yukihiro Matsumoto * bignum.c (rb_big_mul0): bignum multiplication without diff --git a/eval.c b/eval.c index 4eeba6f848..fb0160aa93 100644 --- a/eval.c +++ b/eval.c @@ -7153,15 +7153,15 @@ rb_require_safe(fname, safe) } else { ruby_safe_level = 0; + /* loading ruby library should be serialized. */ + if (!loading_tbl) { + loading_tbl = st_init_strtable(); + } + /* partial state */ + ftptr = ruby_strdup(RSTRING_PTR(feature)); + st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); switch (found) { case 'r': - /* loading ruby library should be serialized. */ - if (!loading_tbl) { - loading_tbl = st_init_strtable(); - } - /* partial state */ - ftptr = ruby_strdup(RSTRING(feature)->ptr); - st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); rb_load(path, 0); break; -- cgit v1.2.3