@@ -28,13 +28,13 @@ Date: Wed Feb 22 11:53:00 2023 -0800
28
28
which is very unlikely on Windows, so revert it.
29
29
30
30
diff --git a/load.c b/load.c
31
- index 282bebdb62..636a124d03 100644
31
+ index 818665dde8..e741a32bd0 100644
32
32
--- a/load.c
33
33
+++ b/load.c
34
34
@@ -157,12 +157,6 @@ get_loaded_features(rb_vm_t *vm)
35
35
return vm->loaded_features;
36
36
}
37
-
37
+
38
38
- static VALUE
39
39
- get_loaded_features_realpaths(rb_vm_t *vm)
40
40
- {
@@ -47,7 +47,7 @@ index 282bebdb62..636a124d03 100644
47
47
@@ -360,8 +354,6 @@ get_loaded_features_index(rb_vm_t *vm)
48
48
modified loaded_features. Rebuild the index. */
49
49
st_foreach(vm->loaded_features_index, loaded_features_index_clear_i, 0);
50
-
50
+
51
51
- VALUE realpaths = vm->loaded_features_realpaths;
52
52
- rb_hash_clear(realpaths);
53
53
features = vm->loaded_features;
@@ -69,28 +69,26 @@ index 282bebdb62..636a124d03 100644
69
69
}
70
70
return vm->loaded_features_index;
71
71
}
72
- @@ -1158 ,8 +1141 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
72
+ @@ -1161 ,8 +1144 ,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
73
73
char *volatile ftptr = 0;
74
74
VALUE path;
75
75
volatile VALUE saved_path;
76
76
- volatile VALUE realpath = 0;
77
77
- VALUE realpaths = get_loaded_features_realpaths(th->vm);
78
78
volatile bool reset_ext_config = false;
79
79
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
80
+
81
+ @@ -1192,8 +1173,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
82
+ else if (found == 's' && run_static_ext_init(th->vm, RSTRING_PTR(path))) {
82
83
result = TAG_RETURN;
83
84
}
84
- #endif
85
85
- else if (RTEST(rb_hash_aref(realpaths,
86
86
- realpath = rb_realpath_internal(Qnil, path, 1)))) {
87
- - result = 0;
88
- - }
87
+ result = 0;
88
+ }
89
89
else {
90
- switch (found) {
91
- case 'r':
92
- @@ -1249,10 +1226,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
93
-
90
+ @@ -1249,10 +1228,6 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
91
+
94
92
if (result == TAG_RETURN) {
95
93
rb_provide_feature(th2->vm, path);
96
94
- VALUE real = realpath;
@@ -99,14 +97,14 @@ index 282bebdb62..636a124d03 100644
99
97
- }
100
98
}
101
99
ec->errinfo = saved.errinfo;
102
-
103
- @@ -1470 ,8 +1443 ,6 @@ Init_load(void)
100
+
101
+ @@ -1485 ,8 +1460 ,6 @@ Init_load(void)
104
102
vm->loaded_features = rb_ary_new();
105
103
vm->loaded_features_snapshot = rb_ary_hidden_new(0);
106
104
vm->loaded_features_index = st_init_numtable();
107
105
- vm->loaded_features_realpaths = rb_hash_new();
108
106
- rb_obj_hide(vm->loaded_features_realpaths);
109
-
107
+
110
108
rb_define_global_function("load", rb_f_load, -1);
111
109
rb_define_global_function("require", rb_f_require, 1);
112
110
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
@@ -167,14 +165,14 @@ index 4c2ef9834e..4fa4ec2b54 100644
167
165
rb_gc_mark_movable(vm->orig_progname);
168
166
RUBY_MARK_MOVABLE_UNLESS_NULL(vm->coverages);
169
167
diff --git a/vm_core.h b/vm_core.h
170
- index 4f6e07d818..6b9cfca2cd 100644
168
+ index 1842519edd..eb2265c97d 100644
171
169
--- a/vm_core.h
172
170
+++ b/vm_core.h
173
- @@ -679 ,7 +679 ,6 @@ typedef struct rb_vm_struct {
171
+ @@ -675 ,7 +675 ,6 @@ typedef struct rb_vm_struct {
174
172
VALUE expanded_load_path;
175
173
VALUE loaded_features;
176
174
VALUE loaded_features_snapshot;
177
175
- VALUE loaded_features_realpaths;
178
176
struct st_table *loaded_features_index;
179
177
struct st_table *loading_table;
180
- #if EXTSTATIC
178
+ // For running the init function of statically linked
0 commit comments