From 432c6f425ec0fb3450e491af102a1844bc9c4e53 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sat, 6 Jun 2015 15:14:06 -0400 Subject: [PATCH] Do not cache the type before we finish constructing it. --- src/jltypes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/jltypes.c b/src/jltypes.c index 68577700700d1f..dbe1e2198f1a57 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2008,8 +2008,6 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i ndt->size = 0; ndt->alignment = 1; - if (cacheable) jl_cache_type_(ndt); - if (istuple) ndt->super = jl_any_type; else @@ -2047,6 +2045,7 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i ndt->ninitialized = ntp; else ndt->ninitialized = dt->ninitialized; + if (cacheable) jl_cache_type_(ndt); JL_GC_POP(); return (jl_value_t*)ndt; }