Skip to content

Commit 7015525

Browse files
committed
force a require if binding with different uuid is present.
This works around `Base.Iterators` shadowing `Iterators`, as noted in #21492.
1 parent dc907c7 commit 7015525

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dump.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2282,8 +2282,12 @@ static jl_value_t *read_verify_mod_list(ios_t *s, arraylist_t *dependent_worlds)
22822282
uint64_t uuid = read_uint64(s);
22832283
jl_sym_t *sym = jl_symbol(name);
22842284
jl_module_t *m = NULL;
2285-
if (jl_binding_resolved_p(jl_main_module, sym))
2285+
if (jl_binding_resolved_p(jl_main_module, sym)) {
22862286
m = (jl_module_t*)jl_get_global(jl_main_module, sym);
2287+
// Potentially two modules with the same name.
2288+
if (m && jl_is_module(m) && m->uuid != uuid)
2289+
m = NULL;
2290+
}
22872291
if (!m) {
22882292
static jl_value_t *require_func = NULL;
22892293
if (!require_func)

0 commit comments

Comments
 (0)