@@ -2244,9 +2244,11 @@ static void strip_specializations_(jl_method_instance_t *mi)
22442244 }
22452245 codeinst = jl_atomic_load_relaxed (& codeinst -> next );
22462246 }
2247+ if (jl_options .strip_ir || jl_options .drop_edges ) {
2248+ record_field_change ((jl_value_t * * )& mi -> backedges , NULL );
2249+ }
22472250 if (jl_options .strip_ir ) {
22482251 record_field_change ((jl_value_t * * )& mi -> uninferred , NULL );
2249- record_field_change ((jl_value_t * * )& mi -> backedges , NULL );
22502252 record_field_change ((jl_value_t * * )& mi -> callbacks , NULL );
22512253 }
22522254}
@@ -2300,7 +2302,7 @@ static int strip_all_codeinfos__(jl_typemap_entry_t *def, void *_env)
23002302
23012303static int strip_all_codeinfos_ (jl_methtable_t * mt , void * _env )
23022304{
2303- if (jl_options .strip_ir && mt -> backedges )
2305+ if (( jl_options .strip_ir || jl_options . drop_edges ) && mt -> backedges )
23042306 record_field_change ((jl_value_t * * )& mt -> backedges , NULL );
23052307 return jl_typemap_visitor (mt -> defs , strip_all_codeinfos__ , NULL );
23062308}
@@ -2411,7 +2413,7 @@ static void jl_save_system_image_to_stream(ios_t *f, jl_array_t *mod_array,
24112413{
24122414 htable_new (& field_replace , 0 );
24132415 // strip metadata and IR when requested
2414- if (jl_options .strip_metadata || jl_options .strip_ir )
2416+ if (jl_options .strip_metadata || jl_options .strip_ir || jl_options . drop_edges )
24152417 jl_strip_all_codeinfos ();
24162418
24172419 int en = jl_gc_enable (0 );
0 commit comments