@@ -851,8 +851,14 @@ static void jl_queue_module_for_serialization(jl_serializer_state *s, jl_module_
851
851
jl_queue_for_serialization (s , module_usings_getmod (m , i ));
852
852
}
853
853
854
- jl_queue_for_serialization (s , m -> usings_backedges );
855
- jl_queue_for_serialization (s , m -> scanned_methods );
854
+ if (jl_options .trim || jl_options .strip_ir ) {
855
+ record_field_change ((jl_value_t * * )& m -> usings_backedges , jl_nothing );
856
+ record_field_change ((jl_value_t * * )& m -> scanned_methods , jl_nothing );
857
+ }
858
+ else {
859
+ jl_queue_for_serialization (s , m -> usings_backedges );
860
+ jl_queue_for_serialization (s , m -> scanned_methods );
861
+ }
856
862
}
857
863
858
864
// Anything that requires uniquing or fixing during deserialization needs to be "toplevel"
@@ -1367,10 +1373,10 @@ static void jl_write_module(jl_serializer_state *s, uintptr_t item, jl_module_t
1367
1373
newm -> line = 0 ;
1368
1374
newm -> usings_backedges = NULL ;
1369
1375
arraylist_push (& s -> relocs_list , (void * )(reloc_offset + offsetof(jl_module_t , usings_backedges )));
1370
- arraylist_push (& s -> relocs_list , (void * )backref_id (s , m -> usings_backedges , s -> link_ids_relocs ));
1376
+ arraylist_push (& s -> relocs_list , (void * )backref_id (s , get_replaceable_field ( & m -> usings_backedges , 1 ) , s -> link_ids_relocs ));
1371
1377
newm -> scanned_methods = NULL ;
1372
1378
arraylist_push (& s -> relocs_list , (void * )(reloc_offset + offsetof(jl_module_t , scanned_methods )));
1373
- arraylist_push (& s -> relocs_list , (void * )backref_id (s , m -> scanned_methods , s -> link_ids_relocs ));
1379
+ arraylist_push (& s -> relocs_list , (void * )backref_id (s , get_replaceable_field ( & m -> scanned_methods , 1 ) , s -> link_ids_relocs ));
1374
1380
1375
1381
// After reload, everything that has happened in this process happened semantically at
1376
1382
// (for .incremental) or before jl_require_world, so reset this flag.
@@ -3635,7 +3641,7 @@ static int jl_validate_binding_partition(jl_binding_t *b, jl_binding_partition_t
3635
3641
jl_sym_t * name = b -> globalref -> name ;
3636
3642
JL_LOCK (& mod -> lock );
3637
3643
jl_atomic_store_release (& mod -> export_set_changed_since_require_world , 1 );
3638
- if (mod -> usings_backedges ) {
3644
+ if (mod -> usings_backedges != jl_nothing ) {
3639
3645
for (size_t i = 0 ; i < jl_array_len (mod -> usings_backedges ); i ++ ) {
3640
3646
jl_module_t * edge = (jl_module_t * )jl_array_ptr_ref (mod -> usings_backedges , i );
3641
3647
jl_binding_t * importee = jl_get_module_binding (edge , name , 0 );
0 commit comments