Skip to content

Commit 43734b2

Browse files
committed
Initialize ruby stack.
1 parent bc17807 commit 43734b2

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

source/loaders/rb_loader/source/rb_loader_impl.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -424,25 +424,30 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi
424424

425425
log_copy(host->log);
426426

427-
ruby_init();
427+
/* Initialize Ruby */
428+
{
429+
RUBY_INIT_STACK;
428430

429-
ruby_init_loadpath();
431+
ruby_init();
430432

431-
if (rb_loader_impl_initialize_types(impl) != 0)
432-
{
433-
ruby_cleanup(0);
433+
ruby_init_loadpath();
434434

435-
return NULL;
436-
}
435+
if (rb_loader_impl_initialize_types(impl) != 0)
436+
{
437+
ruby_cleanup(0);
437438

438-
if (rb_gv_set("$VERBOSE", Qtrue) != Qtrue)
439-
{
440-
ruby_cleanup(0);
439+
return NULL;
440+
}
441441

442-
return NULL;
443-
}
442+
if (rb_gv_set("$VERBOSE", Qtrue) != Qtrue)
443+
{
444+
ruby_cleanup(0);
444445

445-
log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly");
446+
return NULL;
447+
}
448+
449+
log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly");
450+
}
446451

447452
return (loader_impl_data)&rb_loader_impl_unused;
448453
}

0 commit comments

Comments
 (0)