summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--encoding.c7
-rw-r--r--load.c21
-rw-r--r--transcode.c4
3 files changed, 20 insertions, 12 deletions
@@ -797,11 +797,12 @@ rb_enc_get_from_index(int index)
return must_encindex(index);
}
static int
load_encoding(const char *name)
{
VALUE enclib = rb_sprintf("enc/%s.so", name);
- VALUE verbose = ruby_verbose;
VALUE debug = ruby_debug;
VALUE errinfo;
char *s = RSTRING_PTR(enclib) + 4, *e = RSTRING_END(enclib) - 3;
@@ -814,11 +815,9 @@ load_encoding(const char *name)
++s;
}
enclib = rb_fstring(enclib);
- ruby_verbose = Qfalse;
ruby_debug = Qfalse;
errinfo = rb_errinfo();
- loaded = rb_require_internal(enclib);
- ruby_verbose = verbose;
ruby_debug = debug;
rb_set_errinfo(errinfo);
@@ -767,7 +767,7 @@ rb_f_load(int argc, VALUE *argv, VALUE _)
}
static char *
-load_lock(const char *ftptr)
{
st_data_t data;
st_table *loading_tbl = get_loading_table();
@@ -787,7 +787,7 @@ load_lock(const char *ftptr)
(*init)();
return (char *)"";
}
- if (RTEST(ruby_verbose)) {
VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr);
rb_backtrace_each(rb_str_append, warning);
rb_warning("%"PRIsVALUE, warning);
@@ -1050,7 +1050,7 @@ rb_ext_ractor_safe(bool flag)
* >1: exception
*/
static int
-require_internal(rb_execution_context_t *ec, VALUE fname, int exception)
{
volatile int result = -1;
rb_thread_t *th = rb_ec_thread_ptr(ec);
@@ -1084,7 +1084,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception)
path = saved_path;
if (found) {
- if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
result = 0;
}
else if (!*ftptr) {
@@ -1150,10 +1150,17 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception)
}
int
rb_require_internal(VALUE fname)
{
rb_execution_context_t *ec = GET_EC();
- return require_internal(ec, fname, 1);
}
int
@@ -1162,7 +1169,7 @@ ruby_require_internal(const char *fname, unsigned int len)
struct RString fake;
VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
rb_execution_context_t *ec = GET_EC();
- int result = require_internal(ec, str, 0);
rb_set_errinfo(Qnil);
return result == TAG_RETURN ? 1 : result ? -1 : 0;
}
@@ -1171,7 +1178,7 @@ VALUE
rb_require_string(VALUE fname)
{
rb_execution_context_t *ec = GET_EC();
- int result = require_internal(ec, fname, 1);
if (result > TAG_RETURN) {
EC_JUMP_TAG(ec, result);
@@ -376,6 +376,8 @@ transcode_search_path(const char *sname, const char *dname,
return pathlen; /* is -1 if not found */
}
static const rb_transcoder *
load_transcoder_entry(transcoder_entry_t *entry)
{
@@ -393,7 +395,7 @@ load_transcoder_entry(transcoder_entry_t *entry)
memcpy(path + sizeof(transcoder_lib_prefix) - 1, lib, len);
rb_str_set_len(fn, total_len);
OBJ_FREEZE(fn);
- rb_require_string(fn);
}
if (entry->transcoder)