summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-13 17:29:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-13 17:29:34 +0000
commite7257aa72e817601c033c256c1df388f2b03dcbc (patch)
tree05b647391451d84773ced27a633d33a1ab7cb771 /eval.c
parentb2de95d4afece89abd4ccf536295359f058c2043 (diff)
* eval.c (rb_require_safe): segfault after loading .so.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 0c64af5f8e..928cd37957 100644
--- a/eval.c
+++ b/eval.c
@@ -6062,9 +6062,8 @@ rb_require_safe(fname, safe)
ruby_safe_level = safe;
found = search_required(fname, &feature, &path);
if (found) {
- ftptr = RSTRING(feature)->ptr;
if (!path) {
- load_wait(ftptr);
+ load_wait(RSTRING(feature)->ptr);
result = Qfalse;
}
else {
@@ -6077,9 +6076,9 @@ rb_require_safe(fname, safe)
loading_tbl = st_init_strtable();
}
/* partial state */
- st_insert(loading_tbl,
- (st_data_t)(ftptr = ruby_strdup(ftptr)),
- (st_data_t)curr_thread);
+ ftptr = ruby_strdup(RSTRING(feature)->ptr);
+ st_insert(loading_tbl, (st_data_t)ftptr,
+ (st_data_t)(mutex = rb_thread_mutex_new(Qtrue)));
if (feature == fname && !OBJ_FROZEN(feature)) {
feature = rb_str_dup(feature);
OBJ_FREEZE(feature);