@@ -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..9a2ae8a8dc 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,17 +47,16 @@ 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;
54
54
for (i = 0; i < RARRAY_LEN(features); i++) {
55
55
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)
58
57
}
59
58
reset_loaded_features_snapshot(vm);
60
- -
59
+
61
60
- features = rb_ary_dup(vm->loaded_features_snapshot);
62
61
- long j = RARRAY_LEN(features);
63
62
- for (i = 0; i < j; i++) {
@@ -69,28 +68,28 @@ index 282bebdb62..636a124d03 100644
69
68
}
70
69
return vm->loaded_features_index;
71
70
}
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
73
72
char *volatile ftptr = 0;
74
73
VALUE path;
75
74
volatile VALUE saved_path;
76
75
- volatile VALUE realpath = 0;
77
76
- VALUE realpaths = get_loaded_features_realpaths(th->vm);
78
77
volatile bool reset_ext_config = false;
79
78
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))) {
82
82
result = TAG_RETURN;
83
83
}
84
- #endif
85
84
- else if (RTEST(rb_hash_aref(realpaths,
86
85
- realpath = rb_realpath_internal(Qnil, path, 1)))) {
87
86
- result = 0;
88
87
- }
89
88
else {
90
89
switch (found) {
91
90
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
+
94
93
if (result == TAG_RETURN) {
95
94
rb_provide_feature(th2->vm, path);
96
95
- VALUE real = realpath;
@@ -99,14 +98,14 @@ index 282bebdb62..636a124d03 100644
99
98
- }
100
99
}
101
100
ec->errinfo = saved.errinfo;
102
-
103
- @@ -1470 ,8 +1443 ,6 @@ Init_load(void)
101
+
102
+ @@ -1485 ,8 +1485 ,6 @@ Init_load(void)
104
103
vm->loaded_features = rb_ary_new();
105
104
vm->loaded_features_snapshot = rb_ary_hidden_new(0);
106
105
vm->loaded_features_index = st_init_numtable();
107
106
- vm->loaded_features_realpaths = rb_hash_new();
108
107
- rb_obj_hide(vm->loaded_features_realpaths);
109
-
108
+
110
109
rb_define_global_function("load", rb_f_load, -1);
111
110
rb_define_global_function("require", rb_f_require, 1);
112
111
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
@@ -167,14 +166,14 @@ index 4c2ef9834e..4fa4ec2b54 100644
167
166
rb_gc_mark_movable(vm->orig_progname);
168
167
RUBY_MARK_MOVABLE_UNLESS_NULL(vm->coverages);
169
168
diff --git a/vm_core.h b/vm_core.h
170
- index 4f6e07d818..6b9cfca2cd 100644
169
+ index 1842519edd..eb2265c97d 100644
171
170
--- a/vm_core.h
172
171
+++ b/vm_core.h
173
- @@ -679 ,7 +679 ,6 @@ typedef struct rb_vm_struct {
172
+ @@ -675 ,7 +675 ,6 @@ typedef struct rb_vm_struct {
174
173
VALUE expanded_load_path;
175
174
VALUE loaded_features;
176
175
VALUE loaded_features_snapshot;
177
176
- VALUE loaded_features_realpaths;
178
177
struct st_table *loaded_features_index;
179
178
struct st_table *loading_table;
180
- #if EXTSTATIC
179
+ // For running the init function of statically linked
0 commit comments