@@ -1177,16 +1177,12 @@ jl_code_instance_t *jl_compile_linfo(jl_method_instance_t *mi, jl_code_info_t *s
1177
1177
jl_ptls_t ptls = jl_get_ptls_states ();
1178
1178
jl_code_instance_t *uncached = (jl_code_instance_t *)jl_gc_alloc (ptls, sizeof (jl_code_instance_t ),
1179
1179
jl_code_instance_type);
1180
- uncached->min_world = codeinst->min_world ;
1181
- uncached->max_world = codeinst->max_world ;
1180
+ *uncached = *codeinst;
1182
1181
uncached->functionObjectsDecls .functionObject = NULL ;
1183
1182
uncached->functionObjectsDecls .specFunctionObject = NULL ;
1184
- uncached->rettype = codeinst->rettype ;
1185
1183
uncached->inferred = jl_nothing;
1186
- uncached->rettype_const = codeinst->rettype_const ;
1187
- uncached->invoke = NULL ;
1188
- if (codeinst->invoke == jl_fptr_const_return)
1189
- uncached->invoke = jl_fptr_const_return;
1184
+ if (uncached->invoke != jl_fptr_const_return)
1185
+ uncached->invoke = NULL ;
1190
1186
uncached->specptr .fptr = NULL ;
1191
1187
codeinst = uncached;
1192
1188
}
@@ -3204,6 +3200,7 @@ static jl_cgval_t emit_invoke(jl_codectx_t &ctx, jl_expr_t *ex, jl_value_t *rt)
3204
3200
assert (jl_is_method_instance (mi));
3205
3201
jl_code_instance_t *codeinst = jl_compile_linfo (mi, NULL , ctx.world , ctx.params );
3206
3202
if (codeinst && codeinst->inferred ) {
3203
+ JL_GC_PUSH1 (&codeinst);
3207
3204
const jl_llvm_functions_t &decls = codeinst->functionObjectsDecls ;
3208
3205
if (codeinst->invoke == jl_fptr_const_return) {
3209
3206
assert (codeinst->rettype_const );
@@ -3219,6 +3216,7 @@ static jl_cgval_t emit_invoke(jl_codectx_t &ctx, jl_expr_t *ex, jl_value_t *rt)
3219
3216
handled = true ;
3220
3217
}
3221
3218
}
3219
+ JL_GC_POP ();
3222
3220
}
3223
3221
}
3224
3222
if (!handled) {
0 commit comments