Skip to content

Commit 8469856

Browse files
committed
Fix regressed compilation of uncached code.
1 parent 62d7ec5 commit 8469856

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/codegen.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,16 +1177,12 @@ jl_code_instance_t *jl_compile_linfo(jl_method_instance_t *mi, jl_code_info_t *s
11771177
jl_ptls_t ptls = jl_get_ptls_states();
11781178
jl_code_instance_t *uncached = (jl_code_instance_t*)jl_gc_alloc(ptls, sizeof(jl_code_instance_t),
11791179
jl_code_instance_type);
1180-
uncached->min_world = codeinst->min_world;
1181-
uncached->max_world = codeinst->max_world;
1180+
*uncached = *codeinst;
11821181
uncached->functionObjectsDecls.functionObject = NULL;
11831182
uncached->functionObjectsDecls.specFunctionObject = NULL;
1184-
uncached->rettype = codeinst->rettype;
11851183
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;
11901186
uncached->specptr.fptr = NULL;
11911187
codeinst = uncached;
11921188
}
@@ -3204,6 +3200,7 @@ static jl_cgval_t emit_invoke(jl_codectx_t &ctx, jl_expr_t *ex, jl_value_t *rt)
32043200
assert(jl_is_method_instance(mi));
32053201
jl_code_instance_t *codeinst = jl_compile_linfo(mi, NULL, ctx.world, ctx.params);
32063202
if (codeinst && codeinst->inferred) {
3203+
JL_GC_PUSH1(&codeinst);
32073204
const jl_llvm_functions_t &decls = codeinst->functionObjectsDecls;
32083205
if (codeinst->invoke == jl_fptr_const_return) {
32093206
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)
32193216
handled = true;
32203217
}
32213218
}
3219+
JL_GC_POP();
32223220
}
32233221
}
32243222
if (!handled) {

0 commit comments

Comments
 (0)