aboutsummaryrefslogtreecommitdiffstats
path: root/eval_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval_load.c')
-rw-r--r--eval_load.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/eval_load.c b/eval_load.c
index c71880292c..49a4afaa8c 100644
--- a/eval_load.c
+++ b/eval_load.c
@@ -423,13 +423,11 @@ rb_require_safe(VALUE fname, int safe)
volatile VALUE errinfo = th->errinfo;
int state;
struct {
- NODE *node;
int safe;
} volatile saved;
char *volatile ftptr = 0;
PUSH_TAG();
- saved.node = ruby_current_node;
saved.safe = rb_safe_level();
if ((state = EXEC_TAG()) == 0) {
VALUE path;
@@ -452,7 +450,6 @@ rb_require_safe(VALUE fname, int safe)
break;
case 's':
- ruby_current_node = 0;
ruby_sourcefile = rb_source_filename(RSTRING_PTR(path));
ruby_sourceline = 0;
handle = (long)rb_vm_call_cfunc(ruby_top_self, load_ext,
@@ -468,7 +465,6 @@ rb_require_safe(VALUE fname, int safe)
POP_TAG();
load_unlock(ftptr);
- ruby_current_node = saved.node;
rb_set_safe_level_force(saved.safe);
if (state) {
JUMP_TAG(state);
@@ -502,9 +498,9 @@ init_ext_call(VALUE arg)
void
ruby_init_ext(const char *name, void (*init)(void))
{
- ruby_current_node = 0;
ruby_sourcefile = rb_source_filename(name);
ruby_sourceline = 0;
+
if (load_lock(name)) {
rb_vm_call_cfunc(ruby_top_self, init_ext_call, (VALUE)init, 0, rb_str_new2(name));
rb_provide(name);