Skip to content

Commit

Permalink
Fix regressed compilation of uncached code.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Apr 11, 2019
1 parent 62d7ec5 commit 8469856
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,16 +1177,12 @@ jl_code_instance_t *jl_compile_linfo(jl_method_instance_t *mi, jl_code_info_t *s
jl_ptls_t ptls = jl_get_ptls_states();
jl_code_instance_t *uncached = (jl_code_instance_t*)jl_gc_alloc(ptls, sizeof(jl_code_instance_t),
jl_code_instance_type);
uncached->min_world = codeinst->min_world;
uncached->max_world = codeinst->max_world;
*uncached = *codeinst;
uncached->functionObjectsDecls.functionObject = NULL;
uncached->functionObjectsDecls.specFunctionObject = NULL;
uncached->rettype = codeinst->rettype;
uncached->inferred = jl_nothing;
uncached->rettype_const = codeinst->rettype_const;
uncached->invoke = NULL;
if (codeinst->invoke == jl_fptr_const_return)
uncached->invoke = jl_fptr_const_return;
if (uncached->invoke != jl_fptr_const_return)
uncached->invoke = NULL;
uncached->specptr.fptr = NULL;
codeinst = uncached;
}
Expand Down Expand Up @@ -3204,6 +3200,7 @@ static jl_cgval_t emit_invoke(jl_codectx_t &ctx, jl_expr_t *ex, jl_value_t *rt)
assert(jl_is_method_instance(mi));
jl_code_instance_t *codeinst = jl_compile_linfo(mi, NULL, ctx.world, ctx.params);
if (codeinst && codeinst->inferred) {
JL_GC_PUSH1(&codeinst);
const jl_llvm_functions_t &decls = codeinst->functionObjectsDecls;
if (codeinst->invoke == jl_fptr_const_return) {
assert(codeinst->rettype_const);
Expand All @@ -3219,6 +3216,7 @@ static jl_cgval_t emit_invoke(jl_codectx_t &ctx, jl_expr_t *ex, jl_value_t *rt)
handled = true;
}
}
JL_GC_POP();
}
}
if (!handled) {
Expand Down

0 comments on commit 8469856

Please sign in to comment.