Skip to content

Commit

Permalink
fix incorrect setting of inferred field in jl_get_llvmf_decl (cod…
Browse files Browse the repository at this point in the history
…e_native) (#24642)
  • Loading branch information
JeffBezanson authored Nov 19, 2017
1 parent 6d57635 commit 2e1ac64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1552,17 +1552,17 @@ void *jl_get_llvmf_decl(jl_method_instance_t *linfo, size_t world, bool getwrapp
}

// compile this normally
jl_code_info_t *src = NULL;
if (linfo->inferred == NULL)
linfo->inferred = jl_nothing;
jl_llvm_functions_t decls = jl_compile_linfo(&linfo, NULL, world, &jl_default_cgparams);
src = jl_type_infer(&linfo, world, 0);
jl_llvm_functions_t decls = jl_compile_linfo(&linfo, src, world, &jl_default_cgparams);

if (decls.functionObject == NULL && linfo->jlcall_api == JL_API_CONST && jl_is_method(linfo->def.method)) {
// normally we don't generate native code for these functions, so need an exception here
// This leaks a bit of memory to cache native code that we'll never actually need
JL_LOCK(&codegen_lock);
decls = linfo->functionObjectsDecls;
if (decls.functionObject == NULL) {
jl_code_info_t *src = NULL;
src = jl_type_infer(&linfo, world, 0);
if (!src) {
src = linfo->def.method->generator ? jl_code_for_staged(linfo) : (jl_code_info_t*)linfo->def.method->source;
Expand Down

0 comments on commit 2e1ac64

Please sign in to comment.