Skip to content

Commit 6cdcfef

Browse files
vtjnashKristofferC
authored andcommitted
missing gc-root store in subtype (#56472)
Fixes #56141 Introduced by #52228 (a624d44) (cherry picked from commit 671cd5e)
1 parent 57a2920 commit 6cdcfef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/subtype.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,12 +4641,12 @@ static jl_value_t *insert_nondiagonal(jl_value_t *type, jl_varbinding_t *troot,
46414641
jl_value_t *n = jl_unwrap_vararg_num(type);
46424642
if (widen2ub == 0)
46434643
widen2ub = !(n && jl_is_long(n)) || jl_unbox_long(n) > 1;
4644-
jl_value_t *newt;
4645-
JL_GC_PUSH2(&newt, &n);
4646-
newt = insert_nondiagonal(t, troot, widen2ub);
4647-
if (t != newt)
4644+
jl_value_t *newt = insert_nondiagonal(t, troot, widen2ub);
4645+
if (t != newt) {
4646+
JL_GC_PUSH1(&newt);
46484647
type = (jl_value_t *)jl_wrap_vararg(newt, n, 0, 0);
4649-
JL_GC_POP();
4648+
JL_GC_POP();
4649+
}
46504650
}
46514651
else if (jl_is_datatype(type)) {
46524652
if (jl_is_tuple_type(type)) {
@@ -4683,7 +4683,7 @@ static jl_value_t *_widen_diagonal(jl_value_t *t, jl_varbinding_t *troot) {
46834683
static jl_value_t *widen_diagonal(jl_value_t *t, jl_unionall_t *u, jl_varbinding_t *troot)
46844684
{
46854685
jl_varbinding_t vb = { u->var, NULL, NULL, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, troot };
4686-
jl_value_t *nt;
4686+
jl_value_t *nt = NULL;
46874687
JL_GC_PUSH2(&vb.innervars, &nt);
46884688
if (jl_is_unionall(u->body))
46894689
nt = widen_diagonal(t, (jl_unionall_t *)u->body, &vb);

0 commit comments

Comments
 (0)