@@ -2244,6 +2244,7 @@ static void jl_prepare_serialization_data(jl_array_t *mod_array, jl_array_t *new
2244
2244
}
2245
2245
2246
2246
if (edges ) {
2247
+ size_t world = jl_atomic_load_acquire (& jl_world_counter );
2247
2248
jl_collect_missing_backedges (jl_type_type_mt );
2248
2249
jl_collect_missing_backedges (jl_nonfunction_mt );
2249
2250
// jl_collect_extext_methods_from_mod and jl_collect_missing_backedges also accumulate data in callers_with_edges.
@@ -2253,7 +2254,7 @@ static void jl_prepare_serialization_data(jl_array_t *mod_array, jl_array_t *new
2253
2254
* method_roots_list = jl_alloc_vec_any (0 );
2254
2255
// Collect the new method roots
2255
2256
jl_collect_new_roots (* method_roots_list , * new_specializations , worklist_key );
2256
- jl_collect_edges (* edges , * ext_targets , * new_specializations );
2257
+ jl_collect_edges (* edges , * ext_targets , * new_specializations , world );
2257
2258
}
2258
2259
assert (edges_map == NULL ); // jl_collect_edges clears this when done
2259
2260
@@ -3271,7 +3272,8 @@ static jl_value_t *jl_restore_package_image_from_stream(ios_t *f, jl_image_t *im
3271
3272
// Add roots to methods
3272
3273
jl_copy_roots (method_roots_list , jl_worklist_key ((jl_array_t * )restored ));
3273
3274
// Handle edges
3274
- jl_insert_backedges ((jl_array_t * )edges , (jl_array_t * )ext_targets , (jl_array_t * )new_specializations ); // restore external backedges (needs to be last)
3275
+ size_t world = jl_atomic_load_acquire (& jl_world_counter );
3276
+ jl_insert_backedges ((jl_array_t * )edges , (jl_array_t * )ext_targets , (jl_array_t * )new_specializations , world ); // restore external backedges (needs to be last)
3275
3277
// reinit ccallables
3276
3278
jl_reinit_ccallable (& ccallable_list , base , NULL );
3277
3279
arraylist_free (& ccallable_list );
0 commit comments