From 7c647031ba33abe7a4e862f9a488a0cb71e023ba 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: http://svn.ruby-lang.org/repos/ruby/trunk@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 66347120c..7bc11350c 100644 --- a/eval.c +++ b/eval.c @@ -7068,15 +7068,15 @@ rb_require_safe(VALUE fname, int 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(path)); + 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_PTR(path)); - st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); rb_load(path, 0); break; -- cgit