summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-14 00:57:05 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-16 18:48:20 +0900
commitddb32e66160ab50849419ef7c7ac584913b79c34 (patch)
treeea29fbe31a05b3651e3a4b41dd07c64c5ff62b9c /load.c
parent5f1385bec0b6cfddbd51fc867ee6dcff2122399b (diff)
downloadruby-ddb32e66160ab50849419ef7c7ac584913b79c34.tar.gz
[Bug #18173] Update loaded_features_index
If $LOADED_FEATURES is changed in the just required file, also the index table needs to be updated before loaded_features_snapshot is reset. If the snapshot is reset without updating the table, the name of the added feature will not be found.
Diffstat (limited to 'load.c')
-rw-r--r--load.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/load.c b/load.c
index 5fb805d7a3..28c17e8b9c 100644
--- a/load.c
+++ b/load.c
@@ -598,6 +598,7 @@ rb_provide_feature(VALUE feature)
}
rb_str_freeze(feature);
+ get_loaded_features_index();
rb_ary_push(features, rb_fstring(feature));
features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1));
reset_loaded_features_snapshot();