Skip to content

Commit

Permalink
Fix jl_get_specialization signature mismatch
Browse files Browse the repository at this point in the history
(partial backport of b7c25d1)
ref #18334
  • Loading branch information
yuyichao authored and tkelman committed Sep 6, 2016
1 parent 2274a88 commit a9e753b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,6 @@ void jl_extern_c(jl_function_t *f, jl_value_t *rt, jl_value_t *argt, char *name)
// for use in reflection from Julia.
// this is paired with jl_dump_function_ir and jl_dump_function_asm in particular ways:
// misuse will leak memory or cause read-after-free
extern "C" JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp);

extern "C" JL_DLLEXPORT
void *jl_get_llvmf(jl_tupletype_t *tt, bool getwrapper, bool getdeclarations)
{
Expand Down Expand Up @@ -1077,7 +1075,7 @@ void *jl_get_llvmf(jl_tupletype_t *tt, bool getwrapper, bool getdeclarations)
// first copy the linfo to avoid corrupting it and
// confusing the compiler about the
// validity of the code it already generated
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals);
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals, 1);
jl_type_infer(temp, 0);
if (temp->code == jl_nothing || temp->inInference) {
JL_GC_POP();
Expand Down Expand Up @@ -1123,7 +1121,7 @@ void *jl_get_llvmf(jl_tupletype_t *tt, bool getwrapper, bool getdeclarations)
// normally we don't generate native code for these functions, so need an exception here
// This leaks a bit of memory to cache the native code that we'll never actually need
if (linfo->functionObjectsDecls.functionObject == NULL) {
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals);
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals, 1);
jl_type_infer(temp, 0);
temp->jlcall_api = 0;
temp->constval = jl_nothing;
Expand Down
2 changes: 0 additions & 2 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ static int8_t jl_cachearg_offset(jl_methtable_t *mt)

/// ----- Insertion logic for special entries ----- ///

JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp, int allow_exec);

// get or create the LambdaInfo for a specialization
JL_DLLEXPORT jl_lambda_info_t *jl_specializations_get_linfo(jl_method_t *m, jl_tupletype_t *type, jl_svec_t *sparams)
{
Expand Down
1 change: 1 addition & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ JL_DLLEXPORT jl_array_t *jl_idtable_rehash(jl_array_t *a, size_t newsz);
JL_DLLEXPORT jl_methtable_t *jl_new_method_table(jl_sym_t *name, jl_module_t *module);
jl_lambda_info_t *jl_get_specialization1(jl_tupletype_t *types);
int jl_has_call_ambiguities(jl_tupletype_t *types, jl_method_t *m);
JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp, int allow_exec);

uint32_t jl_module_next_counter(jl_module_t *m);
void jl_fptr_to_llvm(jl_fptr_t fptr, jl_lambda_info_t *lam, int specsig);
Expand Down

0 comments on commit a9e753b

Please sign in to comment.