Skip to content

Commit

Permalink
only visit nonfunction_mt once when traversing method tables (JuliaLa…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and LilithHafner committed Mar 8, 2022
1 parent 90f4de0 commit 8457b79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static void foreach_mtable_in_module(
jl_typename_t *tn = ((jl_datatype_t*)v)->name;
if (tn->module == m && tn->name == b->name) {
jl_methtable_t *mt = tn->mt;
if (mt != NULL && (jl_value_t*)mt != jl_nothing && mt != jl_type_type_mt) {
if (mt != NULL && (jl_value_t*)mt != jl_nothing && mt != jl_type_type_mt && mt != jl_nonfunction_mt) {
visit(mt, env);
}
}
Expand All @@ -467,6 +467,7 @@ void jl_foreach_reachable_mtable(void (*visit)(jl_methtable_t *mt, void *env), v
JL_GC_PUSH2(&visited, &mod_array);
mod_array = jl_get_loaded_modules();
visit(jl_type_type_mt, env);
visit(jl_nonfunction_mt, env);
if (mod_array) {
int i;
for (i = 0; i < jl_array_len(mod_array); i++) {
Expand Down

0 comments on commit 8457b79

Please sign in to comment.