Skip to content

Commit

Permalink
Fix hidden bug in rb_feature_p
Browse files Browse the repository at this point in the history
lazy assigned load_path searched in loading_table were not expanded (line ruby#186),
but all features, pushed to loading table, are expanded.

This bug is hidden because load_path is allways filled in loaded_features loop (line ruby#160),
but if we try to optimize this loop (http://redmine.ruby-lang.org/issues/5427), 
then load_path could be not filled, and bug exposed.
  • Loading branch information
funny-falcon committed Dec 8, 2011
1 parent 0bfa4ab commit 3ba7525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion load.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c
fs.name = feature;
fs.len = len;
fs.type = type;
fs.load_path = load_path ? load_path : rb_get_load_path();
fs.load_path = load_path ? load_path : rb_get_expanded_load_path();
fs.result = 0;
st_foreach(loading_tbl, loaded_feature_path_i, (st_data_t)&fs);
if ((f = fs.result) != 0) {
Expand Down

0 comments on commit 3ba7525

Please sign in to comment.