Skip to content

Commit

Permalink
Check ci->relocatability before caching external specializations
Browse files Browse the repository at this point in the history
Fixes #48837
  • Loading branch information
timholy committed Mar 3, 2023
1 parent 48b4caa commit 5fc7359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ static int jl_needs_serialization(jl_serializer_state *s, jl_value_t *v) JL_NOTS
else if (jl_typeis(v, jl_task_type)) {
return 0;
}
else if (s->incremental && jl_is_code_instance(v) && !((jl_code_instance_t*)v)->relocatability) {
return 0;
}

return 1;
}
Expand Down
2 changes: 2 additions & 0 deletions src/staticdata_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ static jl_array_t *queue_external_cis(jl_array_t *list)
for (i = n0; i-- > 0; ) {
jl_code_instance_t *ci = (jl_code_instance_t*)jl_array_ptr_ref(list, i);
assert(jl_is_code_instance(ci));
if (!ci->relocatability)
continue;
jl_method_instance_t *mi = ci->def;
jl_method_t *m = mi->def.method;
if (ci->inferred && jl_is_method(m) && jl_object_in_image((jl_value_t*)m->module)) {
Expand Down

0 comments on commit 5fc7359

Please sign in to comment.