Skip to content

Commit 671cd5e

Browse files
authored
missing gc-root store in subtype (#56472)
Fixes #56141 Introduced by #52228 (a624d44)
1 parent 22c5bdc commit 671cd5e

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
@@ -4700,12 +4700,12 @@ static jl_value_t *insert_nondiagonal(jl_value_t *type, jl_varbinding_t *troot,
47004700
jl_value_t *n = jl_unwrap_vararg_num(type);
47014701
if (widen2ub == 0)
47024702
widen2ub = !(n && jl_is_long(n)) || jl_unbox_long(n) > 1;
4703-
jl_value_t *newt;
4704-
JL_GC_PUSH2(&newt, &n);
4705-
newt = insert_nondiagonal(t, troot, widen2ub);
4706-
if (t != newt)
4703+
jl_value_t *newt = insert_nondiagonal(t, troot, widen2ub);
4704+
if (t != newt) {
4705+
JL_GC_PUSH1(&newt);
47074706
type = (jl_value_t *)jl_wrap_vararg(newt, n, 0, 0);
4708-
JL_GC_POP();
4707+
JL_GC_POP();
4708+
}
47094709
}
47104710
else if (jl_is_datatype(type)) {
47114711
if (jl_is_tuple_type(type)) {
@@ -4742,7 +4742,7 @@ static jl_value_t *_widen_diagonal(jl_value_t *t, jl_varbinding_t *troot) {
47424742
static jl_value_t *widen_diagonal(jl_value_t *t, jl_unionall_t *u, jl_varbinding_t *troot)
47434743
{
47444744
jl_varbinding_t vb = { u->var, NULL, NULL, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, troot };
4745-
jl_value_t *nt;
4745+
jl_value_t *nt = NULL;
47464746
JL_GC_PUSH2(&vb.innervars, &nt);
47474747
if (jl_is_unionall(u->body))
47484748
nt = widen_diagonal(t, (jl_unionall_t *)u->body, &vb);

0 commit comments

Comments
 (0)