Skip to content

Commit b04ea0d

Browse files
committed
Do not cache the type before we finish constructing it.
1 parent 01abdc3 commit b04ea0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jltypes.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,8 +2008,6 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i
20082008
ndt->size = 0;
20092009
ndt->alignment = 1;
20102010

2011-
if (cacheable) jl_cache_type_(ndt);
2012-
20132011
if (istuple)
20142012
ndt->super = jl_any_type;
20152013
else
@@ -2047,6 +2045,10 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i
20472045
ndt->ninitialized = ntp;
20482046
else
20492047
ndt->ninitialized = dt->ninitialized;
2048+
2049+
if (cacheable)
2050+
jl_cache_type_(ndt);
2051+
20502052
JL_GC_POP();
20512053
return (jl_value_t*)ndt;
20522054
}

0 commit comments

Comments
 (0)