Skip to content

Commit 97c40ed

Browse files
authored
Merge pull request #20888 from JuliaLang/kf/missingroot
Fix missing GC root
2 parents 08f00b5 + 86d103c commit 97c40ed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/gf.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,12 +2584,13 @@ static int ml_matches_visitor(jl_typemap_entry_t *ml, struct typemap_intersectio
25842584
// add it to the results.
25852585
if (return_this_match && meth->ambig != jl_nothing && (!closure->include_ambiguous || done)) {
25862586
jl_svec_t *env = NULL;
2587-
JL_GC_PUSH1(&env);
2587+
jl_value_t *mti = NULL;
2588+
JL_GC_PUSH2(&env, &mti);
25882589
for (size_t j = 0; j < jl_array_len(meth->ambig); j++) {
25892590
jl_method_t *mambig = (jl_method_t*)jl_array_ptr_ref(meth->ambig, j);
25902591
env = jl_emptysvec;
2591-
jl_value_t *mti = jl_type_intersection_env((jl_value_t*)closure->match.type,
2592-
(jl_value_t*)mambig->sig, &env);
2592+
mti = jl_type_intersection_env((jl_value_t*)closure->match.type,
2593+
(jl_value_t*)mambig->sig, &env);
25932594
if (mti != (jl_value_t*)jl_bottom_type) {
25942595
if (closure->include_ambiguous) {
25952596
assert(done);
@@ -2602,8 +2603,8 @@ static int ml_matches_visitor(jl_typemap_entry_t *ml, struct typemap_intersectio
26022603
if (len == 0) {
26032604
closure->t = (jl_value_t*)jl_alloc_vec_any(0);
26042605
}
2605-
jl_array_ptr_1d_push((jl_array_t*)closure->t,
2606-
(jl_value_t*)jl_svec(3, mti, env, mambig));
2606+
mti = (jl_value_t*)jl_svec(3, mti, env, mambig);
2607+
jl_array_ptr_1d_push((jl_array_t*)closure->t, mti);
26072608
len++;
26082609
}
26092610
}

0 commit comments

Comments
 (0)