@@ -28,13 +28,13 @@ Date: Wed Feb 22 11:53:00 2023 -0800
2828 which is very unlikely on Windows, so revert it.
2929
3030diff --git a/load.c b/load.c
31- index 282bebdb62..636a124d03 100644
31+ index 818665dde8..9a2ae8a8dc 100644
3232--- a/load.c
3333+++ b/load.c
3434@@ -157,12 +157,6 @@ get_loaded_features(rb_vm_t *vm)
3535 return vm->loaded_features;
3636 }
37-
37+
3838- static VALUE
3939- get_loaded_features_realpaths(rb_vm_t *vm)
4040- {
@@ -47,17 +47,16 @@ index 282bebdb62..636a124d03 100644
4747@@ -360,8 +354,6 @@ get_loaded_features_index(rb_vm_t *vm)
4848 modified loaded_features. Rebuild the index. */
4949 st_foreach(vm->loaded_features_index, loaded_features_index_clear_i, 0);
50-
50+
5151- VALUE realpaths = vm->loaded_features_realpaths;
5252- rb_hash_clear(realpaths);
5353 features = vm->loaded_features;
5454 for (i = 0; i < RARRAY_LEN(features); i++) {
5555 VALUE entry, as_str;
56- @@ -373,15 +365,6 @@ get_loaded_features_index(rb_vm_t *vm)
57- features_index_add(vm, as_str, INT2FIX(i));
56+ @@ -374,14 +366,6 @@ get_loaded_features_index(rb_vm_t *vm)
5857 }
5958 reset_loaded_features_snapshot(vm);
60- -
59+
6160- features = rb_ary_dup(vm->loaded_features_snapshot);
6261- long j = RARRAY_LEN(features);
6362- for (i = 0; i < j; i++) {
@@ -69,28 +68,28 @@ index 282bebdb62..636a124d03 100644
6968 }
7069 return vm->loaded_features_index;
7170 }
72- @@ -1158 ,8 +1141 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
71+ @@ -1161 ,8 +1145 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
7372 char *volatile ftptr = 0;
7473 VALUE path;
7574 volatile VALUE saved_path;
7675- volatile VALUE realpath = 0;
7776- VALUE realpaths = get_loaded_features_realpaths(th->vm);
7877 volatile bool reset_ext_config = false;
7978 struct rb_ext_config prev_ext_config;
80-
81- @@ -1192,10 +1173,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
79+
80+ @@ -1192,10 +1174,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
81+ else if (found == 's' && run_static_ext_init(th->vm, RSTRING_PTR(path))) {
8282 result = TAG_RETURN;
8383 }
84- #endif
8584- else if (RTEST(rb_hash_aref(realpaths,
8685- realpath = rb_realpath_internal(Qnil, path, 1)))) {
8786- result = 0;
8887- }
8988 else {
9089 switch (found) {
9190 case 'r':
92- @@ -1249,10 +1226 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
93-
91+ @@ -1249,10 +1227 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
92+
9493 if (result == TAG_RETURN) {
9594 rb_provide_feature(th2->vm, path);
9695- VALUE real = realpath;
@@ -99,14 +98,14 @@ index 282bebdb62..636a124d03 100644
9998- }
10099 }
101100 ec->errinfo = saved.errinfo;
102-
103- @@ -1470 ,8 +1443 ,6 @@ Init_load(void)
101+
102+ @@ -1485 ,8 +1485 ,6 @@ Init_load(void)
104103 vm->loaded_features = rb_ary_new();
105104 vm->loaded_features_snapshot = rb_ary_hidden_new(0);
106105 vm->loaded_features_index = st_init_numtable();
107106- vm->loaded_features_realpaths = rb_hash_new();
108107- rb_obj_hide(vm->loaded_features_realpaths);
109-
108+
110109 rb_define_global_function("load", rb_f_load, -1);
111110 rb_define_global_function("require", rb_f_require, 1);
112111diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
@@ -167,14 +166,14 @@ index 4c2ef9834e..4fa4ec2b54 100644
167166 rb_gc_mark_movable(vm->orig_progname);
168167 RUBY_MARK_MOVABLE_UNLESS_NULL(vm->coverages);
169168diff --git a/vm_core.h b/vm_core.h
170- index 4f6e07d818..6b9cfca2cd 100644
169+ index 1842519edd..eb2265c97d 100644
171170--- a/vm_core.h
172171+++ b/vm_core.h
173- @@ -679 ,7 +679 ,6 @@ typedef struct rb_vm_struct {
172+ @@ -675 ,7 +675 ,6 @@ typedef struct rb_vm_struct {
174173 VALUE expanded_load_path;
175174 VALUE loaded_features;
176175 VALUE loaded_features_snapshot;
177176- VALUE loaded_features_realpaths;
178177 struct st_table *loaded_features_index;
179178 struct st_table *loading_table;
180- #if EXTSTATIC
179+ // For running the init function of statically linked
0 commit comments