@@ -1758,6 +1758,7 @@ void gc_sweep_sysimg(void)
1758
1758
last_pos = pos ;
1759
1759
jl_taggedvalue_t * o = (jl_taggedvalue_t * )(base + pos );
1760
1760
o -> bits .gc = GC_OLD ;
1761
+ assert (o -> bits .in_image == 1 );
1761
1762
}
1762
1763
}
1763
1764
}
@@ -2811,7 +2812,7 @@ static void jl_restore_system_image_from_stream_(ios_t *f, jl_image_t *image, jl
2811
2812
* base = image_base ;
2812
2813
2813
2814
s .s = & sysimg ;
2814
- jl_read_reloclist (& s , s .link_ids_gctags , GC_OLD ); // gctags
2815
+ jl_read_reloclist (& s , s .link_ids_gctags , GC_OLD | GC_IN_IMAGE ); // gctags
2815
2816
size_t sizeof_tags = ios_pos (& relocs );
2816
2817
(void )sizeof_tags ;
2817
2818
jl_read_reloclist (& s , s .link_ids_relocs , 0 ); // general relocs
@@ -2922,7 +2923,7 @@ static void jl_restore_system_image_from_stream_(ios_t *f, jl_image_t *image, jl
2922
2923
arraylist_push (& cleanup_list , (void * )obj );
2923
2924
}
2924
2925
if (tag )
2925
- * pfld = (uintptr_t )newobj | GC_OLD ;
2926
+ * pfld = (uintptr_t )newobj | GC_OLD | GC_IN_IMAGE ;
2926
2927
else
2927
2928
* pfld = (uintptr_t )newobj ;
2928
2929
assert (!(image_base < (char * )newobj && (char * )newobj <= image_base + sizeof_sysimg + sizeof (uintptr_t )));
@@ -2965,6 +2966,7 @@ static void jl_restore_system_image_from_stream_(ios_t *f, jl_image_t *image, jl
2965
2966
memset (o , 0xba , sizeof (jl_value_t * ) + sizeof (jl_datatype_t ));
2966
2967
else
2967
2968
memset (o , 0xba , sizeof (jl_value_t * ) + 0 ); // singleton
2969
+ o -> bits .in_image = 1 ;
2968
2970
}
2969
2971
arraylist_grow (& cleanup_list , - cleanup_list .len );
2970
2972
// finally cache all our new types now
@@ -3032,6 +3034,7 @@ static void jl_restore_system_image_from_stream_(ios_t *f, jl_image_t *image, jl
3032
3034
jl_value_t * t = jl_typeof (item );
3033
3035
if (t == (jl_value_t * )jl_method_instance_type )
3034
3036
memset (o , 0xba , sizeof (jl_value_t * ) * 3 ); // only specTypes and sparams fields stored
3037
+ o -> bits .in_image = 1 ;
3035
3038
}
3036
3039
arraylist_free (& cleanup_list );
3037
3040
for (size_t i = 0 ; i < s .fixup_objs .len ; i ++ ) {
0 commit comments