Skip to content

Commit

Permalink
dump: ensure jlcall_api is cleared if we don't load the fptr from the…
Browse files Browse the repository at this point in the history
… sysimg
  • Loading branch information
vtjnash committed Mar 28, 2017
1 parent e678e67 commit a159ac5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,15 @@ static void jl_update_all_fptrs(void)
{
//jl_printf(JL_STDOUT, "delayed_fptrs_n: %d\n", delayed_fptrs_n);
void **fvars = sysimg_fvars;
if (fvars == 0) return;
if (fvars == NULL) {
size_t i;
for (i = 0; i < delayed_fptrs_n; i++) {
jl_method_instance_t *li = delayed_fptrs[i].li;
assert(li->jlcall_api && li->jlcall_api != 2);
li->jlcall_api = 0;
}
return;
}
// jl_fptr_to_llvm needs to decompress some ASTs, therefore this needs to be NULL
// to skip trying to restore GlobalVariable pointers in jl_deserialize_gv
sysimg_gvars = NULL;
Expand All @@ -431,7 +439,7 @@ static void jl_update_all_fptrs(void)
jl_method_instance_t **linfos = (jl_method_instance_t**)malloc(sizeof(jl_method_instance_t*) * sysimg_fvars_max);
for (i = 0; i < delayed_fptrs_n; i++) {
jl_method_instance_t *li = delayed_fptrs[i].li;
assert(li->def);
assert(li->def && li->jlcall_api && li->jlcall_api != 2);
int32_t cfunc = delayed_fptrs[i].cfunc - 1;
if (cfunc >= 0) {
jl_fptr_to_llvm((jl_fptr_t)fvars[cfunc], li, 1);
Expand Down

0 comments on commit a159ac5

Please sign in to comment.