@@ -1758,6 +1758,7 @@ void gc_sweep_sysimg(void)
17581758 last_pos = pos ;
17591759 jl_taggedvalue_t * o = (jl_taggedvalue_t * )(base + pos );
17601760 o -> bits .gc = GC_OLD ;
1761+ assert (o -> bits .in_image == 1 );
17611762 }
17621763 }
17631764}
@@ -2811,7 +2812,7 @@ static void jl_restore_system_image_from_stream_(ios_t *f, jl_image_t *image, jl
28112812 * base = image_base ;
28122813
28132814 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
28152816 size_t sizeof_tags = ios_pos (& relocs );
28162817 (void )sizeof_tags ;
28172818 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
29222923 arraylist_push (& cleanup_list , (void * )obj );
29232924 }
29242925 if (tag )
2925- * pfld = (uintptr_t )newobj | GC_OLD ;
2926+ * pfld = (uintptr_t )newobj | GC_OLD | GC_IN_IMAGE ;
29262927 else
29272928 * pfld = (uintptr_t )newobj ;
29282929 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
29652966 memset (o , 0xba , sizeof (jl_value_t * ) + sizeof (jl_datatype_t ));
29662967 else
29672968 memset (o , 0xba , sizeof (jl_value_t * ) + 0 ); // singleton
2969+ o -> bits .in_image = 1 ;
29682970 }
29692971 arraylist_grow (& cleanup_list , - cleanup_list .len );
29702972 // 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
30323034 jl_value_t * t = jl_typeof (item );
30333035 if (t == (jl_value_t * )jl_method_instance_type )
30343036 memset (o , 0xba , sizeof (jl_value_t * ) * 3 ); // only specTypes and sparams fields stored
3037+ o -> bits .in_image = 1 ;
30353038 }
30363039 arraylist_free (& cleanup_list );
30373040 for (size_t i = 0 ; i < s .fixup_objs .len ; i ++ ) {
0 commit comments